diff options
author | Diego Heras <[email protected]> | 2022-08-15 20:30:28 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-08-15 14:30:28 -0400 |
commit | bc0a7c2e0fa2f032a299151bdea76b97cfeae6ef (patch) | |
tree | 6b08eea724f91faea37989fd1d1adb64fa2fd27c | |
parent | c74f9e9602ed3c426e4e01ffc4acef44a127168b (diff) | |
download | bazarr-bc0a7c2e0fa2f032a299151bdea76b97cfeae6ef.tar.gz bazarr-bc0a7c2e0fa2f032a299151bdea76b97cfeae6ef.zip |
Fix issue in external subtitles cache. #1916v1.1.1-beta.13
-rw-r--r-- | bazarr/subtitles/indexer/utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bazarr/subtitles/indexer/utils.py b/bazarr/subtitles/indexer/utils.py index 354133e4b..c40fdff48 100644 --- a/bazarr/subtitles/indexer/utils.py +++ b/bazarr/subtitles/indexer/utils.py @@ -48,8 +48,15 @@ def guess_external_subtitles(dest_folder, subtitles, media_type, previously_inde else path_mappings.path_replace_reverse_movie(subtitle_path) if previously_indexed_subtitles_to_exclude: - if [x for x in previously_indexed_subtitles_to_exclude - if x[1] == reversed_subtitle_path and x[2] == os.stat(subtitle_path).st_size]: + x_found_lang = None + for x_lang, x_path, x_size in previously_indexed_subtitles_to_exclude: + if x_path == reversed_subtitle_path and x_size == os.stat(subtitle_path).st_size: + x_found_lang = x_lang + break + if x_found_lang: + if not language: + x_hi = ':hi' in x_found_lang + subtitles[subtitle] = Language.rebuild(Language.fromietf(x_found_lang), hi=x_hi) continue if not language: |