diff options
author | morpheus65535 <[email protected]> | 2022-10-26 10:42:44 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-10-26 10:42:44 -0400 |
commit | a1594e5a08614ac92f4cec7ac532521860a4ae5b (patch) | |
tree | 049d02c9e717c566bbaa21399554c5d1ac8e8086 | |
parent | f60449aad58c3c0d047a0ff8dc00cf85de300da4 (diff) | |
download | bazarr-a1594e5a08614ac92f4cec7ac532521860a4ae5b.tar.gz bazarr-a1594e5a08614ac92f4cec7ac532521860a4ae5b.zip |
Added automatic update of wanted subtitles count on use embedded subtitles settings modification.
-rw-r--r-- | bazarr/app/config.py | 14 |
1 files changed, 14 insertions, 0 deletions
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)) |