Fix AcoustID high-confidence skip letting wrong files through

The high-confidence fingerprint skip (≥0.95) assumed title mismatches
were language/script differences and bypassed verification. But a high
fingerprint score just means AcoustID identified the audio confidently —
not that it matches the requested track. Now requires partial title
(≥0.55) or artist (≥0.60) similarity before skipping, so completely
wrong files (e.g. different song/artist from same remix producer) are
correctly rejected.
This commit is contained in:
Broque Thomas 2026-04-20 12:46:01 -07:00
parent 059357b91f
commit 1695953705

View file

@ -330,11 +330,13 @@ class AcoustIDVerification:
logger.info(f"AcoustID verification PASSED (scan match) - {msg}") logger.info(f"AcoustID verification PASSED (scan match) - {msg}")
return VerificationResult.PASS, msg return VerificationResult.PASS, msg
# No match found — but if fingerprint score is very high (≥0.95), # No match found — but if fingerprint score is very high (≥0.95)
# the audio IS correct and the title mismatch is likely a language # AND there's partial similarity in title or artist, the mismatch is
# difference (e.g. Japanese kanji vs English title for the same song). # likely a language/script difference (e.g. Japanese kanji vs English).
# Skip rather than quarantine a correct file. # Skip rather than quarantine a correct file.
if best_score >= 0.95: # But if both title AND artist similarity are very low, the download
# source gave us a completely wrong file — fail it.
if best_score >= 0.95 and (title_sim >= 0.55 or artist_sim >= ARTIST_MATCH_THRESHOLD):
top = recordings[0] top = recordings[0]
msg = ( msg = (
f"Title/artist mismatch but fingerprint confidence very high ({best_score:.2f}): " f"Title/artist mismatch but fingerprint confidence very high ({best_score:.2f}): "