From 33ddcf3cffb7b3cd6c7e15c288b7377bcae0676a Mon Sep 17 00:00:00 2001 From: sfaulds Date: Fri, 29 Sep 2017 09:42:59 +1000 Subject: [PATCH] version check every 2 hours --- service.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/service.py b/service.py index f29c822..65ed472 100644 --- a/service.py +++ b/service.py @@ -290,10 +290,10 @@ class Service(xbmc.Player): monitor = Service() -last_progress_update = time.time() -download_utils.checkVersion() home_window = HomeWindow() +last_progress_update = time.time() last_content_check = time.time() +last_version_check = 0 # monitor.abortRequested() is causes issues, it currently triggers for all addon cancelations which causes # the service to exit when a user cancels an addon load action. This is a bug in Kodi. @@ -320,6 +320,11 @@ while not xbmc.abortRequested: last_content_check = time.time() checkForNewContent() + # check version + if (time.time() - last_version_check) > (60 * 60 * 2): # every 2 hours + last_version_check = time.time() + download_utils.checkVersion() + except Exception as error: log.error("Exception in Playback Monitor : " + str(error)) log.error(traceback.format_exc())