Skip to content

Commit

Permalink
Avoid FileNotFoundError indexing subtitles (#2273)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitiko98 authored Oct 21, 2023
1 parent e3cda5c commit c2aef83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/subliminal_patch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,14 +872,14 @@ def _search_external_subtitles(path, languages=None, only_one=False, match_stric
dirpath, filename = os.path.split(path)
dirpath = dirpath or '.'
fn_no_ext, fileext = os.path.splitext(filename)
fn_no_ext_lower = unicodedata.normalize('NFC', fn_no_ext.lower())
fn_no_ext_lower = fn_no_ext.lower() # unicodedata.normalize('NFC', fn_no_ext.lower())
subtitles = {}

for entry in scandir(dirpath):
if not entry.is_file(follow_symlinks=False):
continue

p = unicodedata.normalize('NFC', entry.name)
p = entry.name # unicodedata.normalize('NFC', entry.name)

# keep only valid subtitle filenames
if not p.lower().endswith(SUBTITLE_EXTENSIONS):
Expand Down

0 comments on commit c2aef83

Please sign in to comment.