diff --git a/addon.xml b/addon.xml index 3f1f70c..524a24f 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/cache_images.py b/resources/lib/cache_images.py index 6b6b70f..69cf563 100644 --- a/resources/lib/cache_images.py +++ b/resources/lib/cache_images.py @@ -34,6 +34,9 @@ class CacheArtwork(threading.Thread): self.stop_all_activity = False super(CacheArtwork, self).__init__() + def stop_activity(self): + self.stop_all_activity = True + def run(self): log.debug("CacheArtwork background thread started") last_update = 0 @@ -42,15 +45,22 @@ class CacheArtwork(threading.Thread): latest_content_hash = "never" check_interval = int(settings.getSetting('cacheImagesOnScreenSaver_interval')) check_interval = check_interval * 60 + monitor = xbmc.Monitor() - while not self.stop_all_activity and not xbmc.abortRequested: + while not self.stop_all_activity and not monitor.abortRequested(): content_hash = home_window.getProperty("embycon_widget_reload") if (check_interval != 0 and (time.time() - last_update) > check_interval) or (latest_content_hash != content_hash): + log.debug("CacheArtwork background thread - triggered") + if monitor.waitForAbort(10): + break + if self.stop_all_activity or monitor.abortRequested(): + break self.cache_artwork_background() last_update = time.time() latest_content_hash = content_hash - xbmc.sleep(1000) + monitor.waitForAbort(1) + log.debug("CacheArtwork background thread exited : stop_all_activity : {0}", self.stop_all_activity) def delete_cached_images(self, item_id): diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index ebdca3e..09961e9 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -396,7 +396,7 @@ class DownloadUtils: if not imageTag and not ((art_type == 'Banner' or art_type == 'Art') and parent is True): # ParentTag not passed for Banner and Art - log.debug("No Image Tag for request:{0} item:{1} parent:{2}", art_type, item_type, parent) + # log.debug("No Image Tag for request:{0} item:{1} parent:{2}", art_type, item_type, parent) return "" artwork = "%s/emby/Items/%s/Images/%s/%s?Format=original&Tag=%s" % (server, id, art_type, index, imageTag) diff --git a/resources/lib/play_utils.py b/resources/lib/play_utils.py index 9efac38..cedf1ba 100644 --- a/resources/lib/play_utils.py +++ b/resources/lib/play_utils.py @@ -1133,7 +1133,7 @@ class PlaybackService(xbmc.Monitor): log.debug("Screen Saver Deactivated") if self.background_image_cache_thread: - self.background_image_cache_thread.stop_all_activity = True + self.background_image_cache_thread.stop_activity() self.background_image_cache_thread = None settings = xbmcaddon.Addon()