Loosen near-year match threshold when only one candidate exists

This commit is contained in:
Justin Oro
2026-09-03 15:45:32 -07:00
parent d7b7ee8b71
commit cdb7e9a6f8
+2 -1
View File
@@ -854,7 +854,8 @@ def best_match(media_type, results, year, query=None):
]
if near_year_matches:
best = max(near_year_matches, key=near_title_similarity)
if near_title_similarity(best) >= NEAR_YEAR_MATCH_MIN_SIMILARITY:
threshold = YEAR_MATCH_MIN_SIMILARITY if len(near_year_matches) == 1 else NEAR_YEAR_MATCH_MIN_SIMILARITY
if near_title_similarity(best) >= threshold:
return best
return None
if not query_norm: