diff options
author | morpheus65535 <[email protected]> | 2022-03-30 14:13:18 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-03-30 14:13:18 -0400 |
commit | 4f42cd9b2860856b3759cd438d9fdcfef5a5fdba (patch) | |
tree | 68d10cf030cef6a55496c5d857ae50a0f5c5d4c1 | |
parent | ea9ad0625fd4411dfc0885820c4e2abbd11f3fb8 (diff) | |
download | bazarr-4f42cd9b2860856b3759cd438d9fdcfef5a5fdba.tar.gz bazarr-4f42cd9b2860856b3759cd438d9fdcfef5a5fdba.zip |
Fixed issue with same subtitles downloaded multiple times. #1785v1.0.4-beta.19
-rw-r--r-- | bazarr/get_subtitle/mass_download/movies.py | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/bazarr/get_subtitle/mass_download/movies.py b/bazarr/get_subtitle/mass_download/movies.py index e848c1de8..f71f7c2c8 100644 --- a/bazarr/get_subtitle/mass_download/movies.py +++ b/bazarr/get_subtitle/mass_download/movies.py @@ -48,9 +48,8 @@ def movies_download_subtitles(no): audio_language = 'None' languages = [] - providers_list = None - for i, language in enumerate(ast.literal_eval(movie['missing_subtitles'])): + for language in ast.literal_eval(movie['missing_subtitles']): providers_list = get_providers() if providers_list: @@ -69,39 +68,39 @@ def movies_download_subtitles(no): if language not in ast.literal_eval(confirmed_missing_subs['missing_subtitles']): continue - - show_progress(id='movie_search_progress_{}'.format(no), - header='Searching missing subtitles...', - name=movie['title'], - value=i, - count=count_movie) - - for result in generate_subtitles(path_mappings.path_replace_movie(movie['path']), - languages, - audio_language, - str(movie['sceneName']), - movie['title'], - 'movie'): - - if result: - message = result[0] - path = result[1] - forced = result[5] - if result[8]: - language_code = result[2] + ":hi" - elif forced: - language_code = result[2] + ":forced" - else: - language_code = result[2] - provider = result[3] - score = result[4] - subs_id = result[6] - subs_path = result[7] - store_subtitles_movie(movie['path'], path_mappings.path_replace_movie(movie['path'])) - history_log_movie(1, no, message, path, language_code, provider, score, subs_id, subs_path) - send_notifications_movie(no, message) else: logging.info("BAZARR All providers are throttled") break + show_progress(id='movie_search_progress_{}'.format(no), + header='Searching missing subtitles...', + name=movie['title'], + value=0, + count=count_movie) + + for result in generate_subtitles(path_mappings.path_replace_movie(movie['path']), + languages, + audio_language, + str(movie['sceneName']), + movie['title'], + 'movie'): + + if result: + message = result[0] + path = result[1] + forced = result[5] + if result[8]: + language_code = result[2] + ":hi" + elif forced: + language_code = result[2] + ":forced" + else: + language_code = result[2] + provider = result[3] + score = result[4] + subs_id = result[6] + subs_path = result[7] + store_subtitles_movie(movie['path'], path_mappings.path_replace_movie(movie['path'])) + history_log_movie(1, no, message, path, language_code, provider, score, subs_id, subs_path) + send_notifications_movie(no, message) + hide_progress(id='movie_search_progress_{}'.format(no)) |