From 23c25bd68fdeed2191fd200ff819b93b8569279d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sun, 13 Sep 2020 09:00:36 -0400 Subject: [PATCH] Fix for missing subtitles management after implementing HI. --- bazarr/list_subtitles.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py index 703bc49ac..719b9f83b 100644 --- a/bazarr/list_subtitles.py +++ b/bazarr/list_subtitles.py @@ -241,9 +241,11 @@ def list_missing_subtitles(no=None, epno=None, send_event=True): else: actual_subtitles_list.append(item[0]) missing_subtitles = list(set(desired_subtitles) - set(actual_subtitles_list)) + hi_subs_to_remove = [] for item in missing_subtitles: if item + ':hi' in actual_subtitles_list: - missing_subtitles.remove(item) + hi_subs_to_remove.append(item) + missing_subtitles = list(set(missing_subtitles) - set(hi_subs_to_remove)) missing_subtitles_global.append(tuple([str(missing_subtitles), episode_subtitles['sonarrEpisodeId'], episode_subtitles['sonarrSeriesId']])) @@ -315,10 +317,11 @@ def list_missing_subtitles_movies(no=None, send_event=True): else: actual_subtitles_list.append(item[0]) missing_subtitles = list(set(desired_subtitles) - set(actual_subtitles_list)) - if movie_subtitles['hearing_impaired'] == "False": - for item in missing_subtitles: - if item in actual_subtitles_list or (item + ':hi') in actual_subtitles_list: - missing_subtitles.remove(item) + hi_subs_to_remove = [] + for item in missing_subtitles: + if item + ':hi' in actual_subtitles_list: + hi_subs_to_remove.append(item) + missing_subtitles = list(set(missing_subtitles) - set(hi_subs_to_remove)) missing_subtitles_global.append(tuple([str(missing_subtitles), movie_subtitles['radarrId']])) for missing_subtitles_item in missing_subtitles_global: