From 8abcf386d508934a41b0f8b7b8a6dc1600f540a8 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 18 Mar 2026 12:47:34 -0700 Subject: [PATCH] Fix duplicate detector ignoring similarity settings for remixes Normalization was stripping parenthetical content before comparison, so 'title' and 'title (xxx remix)' both became 'title' and always matched at 1.0 regardless of the user's threshold setting. --- core/repair_jobs/duplicate_detector.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/repair_jobs/duplicate_detector.py b/core/repair_jobs/duplicate_detector.py index c870fa93..da09067d 100644 --- a/core/repair_jobs/duplicate_detector.py +++ b/core/repair_jobs/duplicate_detector.py @@ -207,9 +207,11 @@ class DuplicateDetectorJob(RepairJob): def _normalize(text: str) -> str: - """Normalize text for fuzzy comparison.""" + """Normalize text for fuzzy comparison. + + Keeps parenthetical content (remixes, live, etc.) so that similarity + thresholds can distinguish 'title' from 'title xxx remix'. + """ t = text.lower() - t = re.sub(r'\(.*?\)', '', t) - t = re.sub(r'\[.*?\]', '', t) - t = re.sub(r'[^a-z0-9 ]', '', t) + t = re.sub(r'[^a-z0-9() ]', '', t) return t.strip()