diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-01-29 06:34:19 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-01-29 06:34:19 +0000 |
commit | 6b3505b20c0dd23d57e1efd607128cf57470ac54 (patch) | |
tree | 8dc2bc7939aa9ddcece30e89ebf969fc8f31f4dc | |
parent | fd9c05c61c4523906ec79ff90e1f4688a97b6c1a (diff) | |
download | ampache-6b3505b20c0dd23d57e1efd607128cf57470ac54.tar.gz ampache-6b3505b20c0dd23d57e1efd607128cf57470ac54.tar.bz2 ampache-6b3505b20c0dd23d57e1efd607128cf57470ac54.zip |
added in patch to filter out disabled songs from duplicates display, thx joh6nn
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 15 | ||||
-rw-r--r-- | templates/show_duplicate.inc.php | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index abe0eabc..fd21bec3 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.4-Beta2 + - Added ability to filter disabled songs from duplicate check on + by default (Thx joh6nn) - Added new rating images (Thx greengeek) - Added check for old database versions, prevent upgrade if too old - Fixed issue with user creation (Thx yoog) diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 077620cf..b19a77d6 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -804,14 +804,19 @@ class Catalog { * This function takes a search type and returns a list of all song_ids that * are likely to be duplicates based on teh search method selected. */ - public static function get_duplicate_songs($search_method) { + public static function get_duplicate_songs($search_method) { - // Setup the base SQL + $where_sql = ''; + + if (!$_REQUEST['search_disabled']) { + $where_sql = 'WHERE enabled!=\'0\''; + } + + // Setup the base SQL $sql = "SELECT song.id AS song,artist.id AS artist,album.id AS album,title,COUNT(title) AS ctitle". " FROM `song` LEFT JOIN `artist` ON `artist`.`id`=`song`.`artist` " . - " LEFT JOIN `album` ON `album`.`id`=`song`.`album` ". - " GROUP BY song.title"; - + " LEFT JOIN `album` ON `album`.`id`=`song`.`album` $where_sql GROUP BY `song`.`title`"; + // Add any Additional constraints if ($search_method == "artist_title" OR $search_method == "artist_album_title") { $sql = $sql.",artist.name"; diff --git a/templates/show_duplicate.inc.php b/templates/show_duplicate.inc.php index 1f4ead8e..d3251d8f 100644 --- a/templates/show_duplicate.inc.php +++ b/templates/show_duplicate.inc.php @@ -33,6 +33,8 @@ <input type="radio" name="search_type" value="title"<?php echo $check_title; ?>/><?php echo _('Title'); ?><br /> <input type="radio" name="search_type" value="artist_title"<?php echo $check_artist_title; ?>/><?php echo _('Artist and Title'); ?><br /> <input type="radio" name="search_type" value="artist_album_title"<?php echo $check_artist_album_title; ?>/><?php echo _('Artist, Album and Title'); ?><br /> + <?php if ($_REQUEST['search_disabled']) { $disabled_check = ' checked="checked"'; } ?> + <input type="checkbox" name="search_disabled" value="1" <?php echo $disabled_check; ?>/><?php echo _('Search Disabled Songs'); ?><br /> </td> </tr> </table> |