From a1594e5a08614ac92f4cec7ac532521860a4ae5b Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Wed, 26 Oct 2022 10:42:44 -0400 Subject: [PATCH] Added automatic update of wanted subtitles count on use embedded subtitles settings modification. --- bazarr/app/config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bazarr/app/config.py b/bazarr/app/config.py index b7565e1e1..ec5872ae6 100644 --- a/bazarr/app/config.py +++ b/bazarr/app/config.py @@ -358,6 +358,7 @@ def save_settings(settings_items): exclusion_updated = False sonarr_exclusion_updated = False radarr_exclusion_updated = False + use_embedded_subs_changed = False # Subzero Mods update_subzero = False @@ -389,6 +390,10 @@ def save_settings(settings_items): elif value == 'false': value = 'False' + if key in ['settings-general-use_embedded_subs', 'settings-general-ignore_pgs_subs', + 'settings-general-ignore_vobsub_subs', 'settings-general-ignore_ass_subs']: + use_embedded_subs_changed = True + if key in ['settings-general-base_url', 'settings-sonarr-base_url', 'settings-radarr-base_url']: value = base_url_slash_cleaner(value) @@ -510,6 +515,15 @@ def save_settings(settings_items): update_subzero = True + if use_embedded_subs_changed: + from .scheduler import scheduler + from subtitles.indexer.series import list_missing_subtitles + from subtitles.indexer.movies import list_missing_subtitles_movies + if settings.general.getboolean('use_sonarr'): + scheduler.add_job(list_missing_subtitles, kwargs={'send_event': True}) + if settings.general.getboolean('use_radarr'): + scheduler.add_job(list_missing_subtitles_movies, kwargs={'send_event': True}) + if update_subzero: settings.set('general', 'subzero_mods', ','.join(subzero_mods))