diff --git a/requirements.txt b/requirements.txt index 58f3a6037..0f4f2be37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,5 +12,6 @@ py-pretty pycountry requests subliminal +tzlocal urllib3 waitress \ No newline at end of file diff --git a/scheduler.py b/scheduler.py index cbd730d8c..57ceeb07f 100644 --- a/scheduler.py +++ b/scheduler.py @@ -7,8 +7,13 @@ from check_update import * from apscheduler.schedulers.background import BackgroundScheduler from datetime import datetime +from tzlocal import get_localzone + +if str(get_localzone()) == "local": + scheduler = BackgroundScheduler(timezone=utc) +else: + scheduler = BackgroundScheduler() -scheduler = BackgroundScheduler() if automatic == 'True': scheduler.add_job(check_and_apply_update, 'interval', hours=6, max_instances=1, coalesce=True, misfire_grace_time=15, id='update_bazarr', name='Update bazarr from source on Github') else: diff --git a/update_modules.py b/update_modules.py index 570ec7d4f..ed25717a5 100644 --- a/update_modules.py +++ b/update_modules.py @@ -12,5 +12,10 @@ except SystemExit as e: try: pip.main(['install', '--user', 'apprise']) +except SystemExit as e: + pass + +try: + pip.main(['install', '--user', 'tzlocal']) except SystemExit as e: pass \ No newline at end of file