From 9d81ea07404af6fc19a8a3a69cb537c617b237a0 Mon Sep 17 00:00:00 2001 From: Halali Date: Tue, 26 Mar 2019 22:34:29 +0100 Subject: [PATCH] Fix for #360 --- bazarr/main.py | 6 ++++++ bazarr/scheduler.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bazarr/main.py b/bazarr/main.py index 78a2587ad..bf519c21f 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -1601,14 +1601,20 @@ def system(): def get_time_from_cron(cron): text = "at " + sun = str(cron[4]) hour = str(cron[5]) minute = str(cron[6]) second = str(cron[7]) + + if sun != "*": + text = "Sunday " + text if hour != "0" and hour != "*": text = text + hour if hour == "0" or hour == "1": text = text + " hour" + elif sun != "*" or hour == "4" or hour == "5": + text = text + "am" else: text = text + " hours" diff --git a/bazarr/scheduler.py b/bazarr/scheduler.py index 1cd9bb52a..9856e57da 100644 --- a/bazarr/scheduler.py +++ b/bazarr/scheduler.py @@ -29,12 +29,12 @@ def sonarr_full_update(): misfire_grace_time=15, id='update_all_episodes', name='Update all episodes subtitles from disk', replace_existing=True) 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, misfire_grace_time=15, id='update_all_episodes', name='Update all episodes subtitles from disk', replace_existing=True) 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', 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', replace_existing=True) 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', name='Update all movies subtitles from disk', replace_existing=True)