mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-19 05:18:49 +00:00
Rescheduling of Bazarr update task when saving settings.
This commit is contained in:
parent
dd2cdd6c29
commit
cb7e35a992
2 changed files with 16 additions and 15 deletions
|
@ -1531,14 +1531,12 @@ def save_settings():
|
|||
conn.commit()
|
||||
c.close()
|
||||
|
||||
schedule_update_job()
|
||||
sonarr_full_update()
|
||||
radarr_full_update()
|
||||
|
||||
logging.info('BAZARR Settings saved succesfully.')
|
||||
|
||||
# reschedule full update task according to settings
|
||||
sonarr_full_update()
|
||||
|
||||
if ref.find('saved=true') > 0:
|
||||
redirect(ref)
|
||||
else:
|
||||
|
|
|
@ -80,19 +80,21 @@ def task_listener(event):
|
|||
|
||||
scheduler.add_listener(task_listener, EVENT_JOB_SUBMITTED | EVENT_JOB_EXECUTED)
|
||||
|
||||
if not args.no_update:
|
||||
if settings.general.getboolean('auto_update'):
|
||||
scheduler.add_job(check_updates, IntervalTrigger(hours=6), max_instances=1, coalesce=True,
|
||||
misfire_grace_time=15, id='update_bazarr', name='Update bazarr from source on Github' if not args.release_update else 'Update bazarr from release on Github')
|
||||
else:
|
||||
scheduler.add_job(check_updates, CronTrigger(year='2100'), hour=4, id='update_bazarr',
|
||||
name='Update bazarr from source on Github' if not args.release_update else 'Update bazarr from release on Github')
|
||||
scheduler.add_job(check_releases, IntervalTrigger(hours=6), max_instances=1, coalesce=True,
|
||||
misfire_grace_time=15, id='update_release', name='Update release info')
|
||||
def schedule_update_job():
|
||||
if not args.no_update:
|
||||
if settings.general.getboolean('auto_update'):
|
||||
scheduler.add_job(check_updates, IntervalTrigger(hours=6), max_instances=1, coalesce=True,
|
||||
misfire_grace_time=15, id='update_bazarr', name='Update bazarr from source on Github' if not args.release_update else 'Update bazarr from release on Github', replace_existing=True)
|
||||
else:
|
||||
scheduler.add_job(check_updates, CronTrigger(year='2100'), hour=4, id='update_bazarr',
|
||||
name='Update bazarr from source on Github' if not args.release_update else 'Update bazarr from release on Github', replace_existing=True)
|
||||
scheduler.add_job(check_releases, IntervalTrigger(hours=6), max_instances=1, coalesce=True,
|
||||
misfire_grace_time=15, id='update_release', name='Update release info', replace_existing=True)
|
||||
|
||||
else:
|
||||
scheduler.add_job(check_releases, IntervalTrigger(hours=6), max_instances=1, coalesce=True, misfire_grace_time=15,
|
||||
id='update_release', name='Update release info', replace_existing=True)
|
||||
|
||||
else:
|
||||
scheduler.add_job(check_releases, IntervalTrigger(hours=6), max_instances=1, coalesce=True, misfire_grace_time=15,
|
||||
id='update_release', name='Update release info')
|
||||
|
||||
if settings.general.getboolean('use_sonarr'):
|
||||
scheduler.add_job(update_series, IntervalTrigger(minutes=1), max_instances=1, coalesce=True, misfire_grace_time=15,
|
||||
|
@ -112,6 +114,7 @@ if settings.general.getboolean('upgrade_subs'):
|
|||
scheduler.add_job(upgrade_subtitles, IntervalTrigger(hours=12), max_instances=1, coalesce=True,
|
||||
misfire_grace_time=15, id='upgrade_subtitles', name='Upgrade previously downloaded subtitles')
|
||||
|
||||
schedule_update_job()
|
||||
sonarr_full_update()
|
||||
radarr_full_update()
|
||||
scheduler.start()
|
||||
|
|
Loading…
Reference in a new issue