pull/380/head
Halali 6 years ago
parent a1a1ee68f1
commit 9d81ea0740

@ -1601,14 +1601,20 @@ def system():
def get_time_from_cron(cron): def get_time_from_cron(cron):
text = "at " text = "at "
sun = str(cron[4])
hour = str(cron[5]) hour = str(cron[5])
minute = str(cron[6]) minute = str(cron[6])
second = str(cron[7]) second = str(cron[7])
if sun != "*":
text = "Sunday " + text
if hour != "0" and hour != "*": if hour != "0" and hour != "*":
text = text + hour text = text + hour
if hour == "0" or hour == "1": if hour == "0" or hour == "1":
text = text + " hour" text = text + " hour"
elif sun != "*" or hour == "4" or hour == "5":
text = text + "am"
else: else:
text = text + " hours" text = text + " hours"

@ -29,12 +29,12 @@ def sonarr_full_update():
misfire_grace_time=15, id='update_all_episodes', misfire_grace_time=15, id='update_all_episodes',
name='Update all episodes subtitles from disk', replace_existing=True) name='Update all episodes subtitles from disk', replace_existing=True)
elif full_update == "Weekly": elif full_update == "Weekly":
scheduler.add_job(update_all_episodes, CronTrigger(day_of_week='sun'), hour=4, max_instances=1, scheduler.add_job(update_all_episodes, CronTrigger(day_of_week='sun', hour=4), max_instances=1,
coalesce=True, coalesce=True,
misfire_grace_time=15, id='update_all_episodes', misfire_grace_time=15, id='update_all_episodes',
name='Update all episodes subtitles from disk', replace_existing=True) name='Update all episodes subtitles from disk', replace_existing=True)
elif full_update == "Manually": elif full_update == "Manually":
scheduler.add_job(update_all_episodes, CronTrigger(year='2100'), hour=4, max_instances=1, coalesce=True, scheduler.add_job(update_all_episodes, CronTrigger(year='2100'), max_instances=1, coalesce=True,
misfire_grace_time=15, id='update_all_episodes', misfire_grace_time=15, id='update_all_episodes',
name='Update all episodes subtitles from disk', replace_existing=True) name='Update all episodes subtitles from disk', replace_existing=True)
@ -48,7 +48,7 @@ def radarr_full_update():
id='update_all_movies', name='Update all movies subtitles from disk', id='update_all_movies', name='Update all movies subtitles from disk',
replace_existing=True) replace_existing=True)
elif full_update == "Weekly": elif full_update == "Weekly":
scheduler.add_job(update_all_movies, CronTrigger(day_of_week='sun'), hour=5, max_instances=1, coalesce=True, scheduler.add_job(update_all_movies, CronTrigger(day_of_week='sun', hour=5), max_instances=1, coalesce=True,
misfire_grace_time=15, id='update_all_movies', misfire_grace_time=15, id='update_all_movies',
name='Update all movies subtitles from disk', name='Update all movies subtitles from disk',
replace_existing=True) replace_existing=True)

Loading…
Cancel
Save