From e1b203405f2ebf9c33e4a6d932a09eedac153341 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:42:49 -0700 Subject: [PATCH] Add ignore cross-album duplicates setting to Duplicate Detector Tracks on different albums (e.g., same song on a studio album and a compilation) are no longer flagged as duplicates by default, keeping albums complete. Setting is enabled by default and configurable via the job settings UI. --- core/repair_jobs/duplicate_detector.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/repair_jobs/duplicate_detector.py b/core/repair_jobs/duplicate_detector.py index da09067d..ee0b9af4 100644 --- a/core/repair_jobs/duplicate_detector.py +++ b/core/repair_jobs/duplicate_detector.py @@ -24,7 +24,9 @@ class DuplicateDetectorJob(RepairJob): '(file path, format, bitrate) so you can decide which to keep.\n\n' 'Settings:\n' '- Title Similarity: How closely titles must match to be considered duplicates (0.0 - 1.0)\n' - '- Artist Similarity: How closely artist names must match (0.0 - 1.0)' + '- Artist Similarity: How closely artist names must match (0.0 - 1.0)\n' + '- Ignore Cross-Album: When enabled, tracks on different albums are not flagged as duplicates ' + '(keeps your albums complete even if the same song appears on multiple albums)' ) icon = 'repair-icon-duplicate' default_enabled = False @@ -32,6 +34,7 @@ class DuplicateDetectorJob(RepairJob): default_settings = { 'title_similarity': 0.85, 'artist_similarity': 0.80, + 'ignore_cross_album': True, } auto_fix = False @@ -41,6 +44,7 @@ class DuplicateDetectorJob(RepairJob): settings = self._get_settings(context) title_threshold = settings.get('title_similarity', 0.85) artist_threshold = settings.get('artist_similarity', 0.80) + ignore_cross_album = settings.get('ignore_cross_album', True) # Fetch all tracks with artist/album names via JOIN tracks = [] @@ -140,6 +144,10 @@ class DuplicateDetectorJob(RepairJob): if artist_sim < artist_threshold: continue + # Skip cross-album duplicates — same song on different albums is intentional + if ignore_cross_album and t1['album'] and t2['album'] and t1['album'] != t2['album']: + continue + group.append(t2) if len(group) >= 2: