Added automatic update of wanted subtitles count on use embedded subtitles settings modification.

pull/1979/head
morpheus65535 2 years ago
parent f60449aad5
commit a1594e5a08

@ -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))

Loading…
Cancel
Save