Use Redump + No-Intro DATs together for games; dedupe fuzzy matches
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user