From 45c8f2cdb8943bb7da7b2c8212a1f5c36f21e050 Mon Sep 17 00:00:00 2001 From: l3uddz Date: Sun, 25 Mar 2018 16:43:47 +0100 Subject: [PATCH] dont schedule automatic movies/shows if corresponding interval is <= 0 --- traktarr.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/traktarr.py b/traktarr.py index 536ab0b..7b5d472 100755 --- a/traktarr.py +++ b/traktarr.py @@ -443,9 +443,12 @@ def automatic_movies(add_delay=2.5, no_search=False, notifications=False): @click.option('--no-notifications', is_flag=True, help="Disable notifications.") def run(add_delay=2.5, no_search=False, no_notifications=False): # add tasks to repeat - schedule.every(cfg.automatic.movies.interval).hours.do(automatic_movies, add_delay, no_search, - not no_notifications) - schedule.every(cfg.automatic.shows.interval).hours.do(automatic_shows, add_delay, no_search, not no_notifications) + if cfg.automatic.movies.interval: + schedule.every(cfg.automatic.movies.interval).hours.do(automatic_movies, add_delay, no_search, + not no_notifications) + if cfg.automatic.shows.interval: + schedule.every(cfg.automatic.shows.interval).hours.do(automatic_shows, add_delay, no_search, + not no_notifications) # run schedule log.info("Automatic mode is now running...")