From 8ceaa9cfdbdb1eba818b68bf16b1da3b75a7f52e Mon Sep 17 00:00:00 2001 From: Justin Oro Date: Sun, 6 Sep 2026 04:56:22 -0700 Subject: [PATCH] Trust a unique exact-title match over an unreliable inferred year --- plex-library-tool.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plex-library-tool.py b/plex-library-tool.py index d4dcdc6..0c7a280 100755 --- a/plex-library-tool.py +++ b/plex-library-tool.py @@ -843,6 +843,10 @@ def best_match(media_type, results, year, query=None): if not query_norm: return None + exact_matches = [r for r in results if is_exact_title(r)] + if len(exact_matches) == 1: + return exact_matches[0] + def near_title_similarity(r): return difflib.SequenceMatcher( None, query_norm, clean_and_squeeze(result_title(media_type, r) or "").lower()