Use Redump + No-Intro DATs together for games; dedupe fuzzy matches

This commit is contained in:
2026-09-07 16:20:39 -04:00
parent 2d599141f9
commit bb1b8dea66
4 changed files with 17529 additions and 3 deletions
+10
View File
@@ -181,6 +181,16 @@ def match(conn, record):
return "unknown", None
top = [cand for ratio, cand in scored if ratio >= best_ratio - 0.001]
top = _narrow(conn, top, size)
# The same disc can exist in multiple catalogs (e.g. No-Intro + Redump);
# collapse identical entries so they don't read as an ambiguous match.
seen = set()
deduped = []
for cand in top:
key = (cand.get("name"), size)
if key not in seen:
seen.add(key)
deduped.append(cand)
top = deduped
if len(top) == 1:
return f"fuzzy:{best_ratio:.2f}", top[0]
return "unknown", None