diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-12-22 06:03:03 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-12-22 06:03:03 +0000 |
commit | 2d06bf58a22f52e3ca3a3d046a48862da1790a40 (patch) | |
tree | e047aa79c2b1f6eb3bf8e7da0b9614503ad8288f /templates/show_list_duplicates.inc.php | |
parent | c9bf00afb1611a05b85088264cb4d42efbb8ab73 (diff) | |
download | ampache-2d06bf58a22f52e3ca3a3d046a48862da1790a40.tar.gz ampache-2d06bf58a22f52e3ca3a3d046a48862da1790a40.tar.bz2 ampache-2d06bf58a22f52e3ca3a3d046a48862da1790a40.zip |
new best guess duplicate logic
Diffstat (limited to 'templates/show_list_duplicates.inc.php')
-rw-r--r-- | templates/show_list_duplicates.inc.php | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/templates/show_list_duplicates.inc.php b/templates/show_list_duplicates.inc.php index b2f39393..41572cc1 100644 --- a/templates/show_list_duplicates.inc.php +++ b/templates/show_list_duplicates.inc.php @@ -5,9 +5,8 @@ All rights reserved. This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,15 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -?> -<?php $web_path = conf('web_path'); show_duplicate_searchbox($search_type); -if ($flags) { ?> + +if (count($flags)) { ?> <?php show_box_top(_('Duplicate Songs')); ?> <form method="post" enctype="multipart/form-data" action="<?php echo $web_path; ?>/admin/flag.php?action=disable"> - <table class="tabledata" cellspacing="0" cellpadding="0" > + <table class="tabledata"> <tr class="table-header"> <td><?php echo _('Disable'); ?></td> <td><?php echo _('Song'); ?></td> @@ -40,34 +38,46 @@ if ($flags) { ?> </tr> <?php foreach ($flags as $flag) { + /* Build the Song */ $song = new Song($flag['song']); $song->format_song(); + + // Set some extra vars $alt_title = $song->title; $formated_title = $song->f_title; $artist = $song->f_artist; $alt_artist = $song->f_full_artist; - $dinfolist = get_duplicate_info($song,$search_type); - foreach ($dinfolist as $dinfo) { - echo "<tr class=\"".flip_class()."\">". - "<td><input type=\"checkbox\" name=\"song_ids[]\" value=\"" . $dinfo['songid'] . "\" /></td>". - "<td><a href=\"".$web_path."/song.php?action=single_song&song_id=$song->id\">".scrub_out($formated_title)."</a> </td>". - "<td><a href=\"".$web_path."/artists.php?action=show&artist=".$dinfo['artistid']."\" title=\"".scrub_out($dinfo['artist'])."\">".scrub_out($dinfo['artist'])."</a> </td>". - "<td><a href=\"".$web_path."/albums.php?action=show&album=".$dinfo['albumid']."\" title=\"".scrub_out($dinfo['album'])."\">".scrub_out($dinfo['album'])."</a> </td>". + + // Gather the duplicates + $dinfolist = get_duplicate_info($song,$search_type,$_REQUEST['auto']); + + // Set the current class, only changes once per set of duplicates + $current_class = flip_class(); + + foreach ($dinfolist as $key=>$dinfo) { + $check_txt = ''; + if ($key == '0' AND $_REQUEST['auto']) { $check_txt = ' checked="checked"'; } + echo "<tr class=\"".$current_class."\">". + "<td><input type=\"checkbox\" name=\"song_ids[]\" value=\"" . $dinfo['songid'] . "\" $check_txt/></td>". + "<td><a href=\"$web_path/song.php?action=single_song&song_id=$song->id\">".scrub_out($formated_title)."</a> </td>". + "<td><a href=\"$web_path/artists.php?action=show&artist=".$dinfo['artistid']."\" title=\"".scrub_out($dinfo['artist'])."\">".scrub_out($dinfo['artist'])."</a> </td>". + "<td><a href=\"$web_path/albums.php?action=show&album=".$dinfo['albumid']."\" title=\"".scrub_out($dinfo['album'])."\">".scrub_out($dinfo['album'])."</a> </td>". "<td>".floor($dinfo['time']/60).":".sprintf("%02d", ($dinfo['time']%60) )."</td>". "<td>".intval($dinfo['bitrate']/1000)."</td>". - "<td>".sprintf("%.2f", ($dinfo['size']/1000000))."Mb</td>". + "<td>".sprintf("%.2f", ($dinfo['size']/1048576))."MB</td>". "<td>".$dinfo['file']."</td>"; echo "</tr>\n"; } // end foreach ($dinfolist as $dinfo) + } // end foreach ($flags as $flag) ?> <tr> - <td colspan="8" class="<?php echo flip_class(); ?>"><input height="15" type="submit" value="Disable Songs" /></td> + <td colspan="8" class="<?php echo flip_class(); ?>"><input type="submit" value="<?php echo _('Disable Songs'); ?>" /></td> </tr> </table> </form> <?php show_box_bottom(); ?> <?php } else { ?> -<p><?php _('You don\'t have any duplicate songs.'); ?></p> +<p class="error"><?php echo _('No Records Found'); ?></p> <?php } // end if ($flags) and else ?> |