From bb8233b599fa0bd8133b092897a4fbcfd736c8cd Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Thu, 6 Jun 2024 06:17:13 -0400 Subject: [PATCH] Fixed external subtitles indexing on some platforms where filesystem encoding may be using a different UTF8 normalization form. --- custom_libs/subliminal_patch/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_libs/subliminal_patch/core.py b/custom_libs/subliminal_patch/core.py index 872896e9c..c1629496b 100644 --- a/custom_libs/subliminal_patch/core.py +++ b/custom_libs/subliminal_patch/core.py @@ -946,8 +946,8 @@ def _search_external_subtitles(path, languages=None, only_one=False, match_stric lambda m: "" if str(m.group(1)).lower() in FULL_LANGUAGE_LIST else m.group(0), p_root) p_root_lower = p_root_bare.lower() - - filename_matches = p_root_lower == fn_no_ext_lower + # comparing to both unicode normalization forms to prevent broking stuff and improve indexing on some platforms. + filename_matches = fn_no_ext_lower in [p_root_lower, unicodedata.normalize('NFC', p_root_lower)] filename_contains = p_root_lower in fn_no_ext_lower if not filename_matches: