From e6c2133bf571a028705131d9c3cca2aa98df753e Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 17 Apr 2020 18:23:47 -0700 Subject: [PATCH] Fix auto-updater not working after enabling unless Tautulli was restarted --- plexpy/__init__.py | 2 +- plexpy/versioncheck.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 1d8b02af..a640163e 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -442,7 +442,7 @@ def initialize_scheduler(): pms_update_check_hours = CONFIG.PMS_UPDATE_CHECK_INTERVAL if 1 <= CONFIG.PMS_UPDATE_CHECK_INTERVAL else 24 schedule_job(versioncheck.check_update, 'Check GitHub for updates', - hours=0, minutes=github_minutes, seconds=0, args=(bool(CONFIG.PLEXPY_AUTO_UPDATE), True)) + hours=0, minutes=github_minutes, seconds=0, args=(True, True)) backup_hours = CONFIG.BACKUP_INTERVAL if 1 <= CONFIG.BACKUP_INTERVAL <= 24 else 6 diff --git a/plexpy/versioncheck.py b/plexpy/versioncheck.py index e0eef858..3914cc38 100644 --- a/plexpy/versioncheck.py +++ b/plexpy/versioncheck.py @@ -135,8 +135,8 @@ def getVersion(): return current_version, 'origin', current_branch -def check_update(auto_update=False, notify=False): - check_github(auto_update=auto_update, notify=notify) +def check_update(scheduler=False, notify=False): + check_github(scheduler=scheduler, notify=notify) if not plexpy.CURRENT_VERSION: plexpy.UPDATE_AVAILABLE = None @@ -159,7 +159,7 @@ def check_update(auto_update=False, notify=False): plexpy.WIN_SYS_TRAY_ICON.update(icon=icon, hover_text=hover_text) -def check_github(auto_update=False, notify=False): +def check_github(scheduler=False, notify=False): plexpy.COMMITS_BEHIND = 0 if plexpy.CONFIG.GIT_TOKEN: @@ -236,7 +236,7 @@ def check_github(auto_update=False, notify=False): 'plexpy_update_commit': plexpy.LATEST_VERSION, 'plexpy_update_behind': plexpy.COMMITS_BEHIND}) - if auto_update and not plexpy.DOCKER: + if scheduler and plexpy.CONFIG.PLEXPY_AUTO_UPDATE and not plexpy.DOCKER: logger.info('Running automatic update.') plexpy.shutdown(restart=True, update=True)