From 6b3505b20c0dd23d57e1efd607128cf57470ac54 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Tue, 29 Jan 2008 06:34:19 +0000 Subject: added in patch to filter out disabled songs from duplicates display, thx joh6nn --- docs/CHANGELOG | 2 ++ lib/class/catalog.class.php | 15 ++++++++++----- 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 @@ />
/>
/>
+ + />
-- cgit