summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/class/catalog.class.php15
-rw-r--r--templates/show_duplicate.inc.php2
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>