summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-29 06:34:19 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-29 06:34:19 +0000
commit6b3505b20c0dd23d57e1efd607128cf57470ac54 (patch)
tree8dc2bc7939aa9ddcece30e89ebf969fc8f31f4dc /lib/class
parentfd9c05c61c4523906ec79ff90e1f4688a97b6c1a (diff)
downloadampache-6b3505b20c0dd23d57e1efd607128cf57470ac54.tar.gz
ampache-6b3505b20c0dd23d57e1efd607128cf57470ac54.tar.bz2
ampache-6b3505b20c0dd23d57e1efd607128cf57470ac54.zip
added in patch to filter out disabled songs from duplicates display, thx joh6nn
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/catalog.class.php15
1 files changed, 10 insertions, 5 deletions
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";