Skip to content

Commit

Permalink
Fixed external subtitles indexing on some platforms where filesystem …
Browse files Browse the repository at this point in the history
…encoding may be using a different UTF8 normalization form.
  • Loading branch information
morpheus65535 committed Jun 6, 2024
1 parent 77302fa commit bb8233b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_libs/subliminal_patch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bb8233b

Please sign in to comment.