Loosen near-year match threshold when only one candidate exists
This commit is contained in:
@@ -854,7 +854,8 @@ def best_match(media_type, results, year, query=None):
|
|||||||
]
|
]
|
||||||
if near_year_matches:
|
if near_year_matches:
|
||||||
best = max(near_year_matches, key=near_title_similarity)
|
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 best
|
||||||
return None
|
return None
|
||||||
if not query_norm:
|
if not query_norm:
|
||||||
|
|||||||
Reference in New Issue
Block a user