From 25a6d820223ec5a15ccf37f3c894da42c16ce120 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sat, 17 Sep 2016 15:17:01 +0200 Subject: [PATCH] Prevent infinite loops after requesting something --- default.py | 11 +++++------ resources/lib/artwork.py | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/default.py b/default.py index f2edfc06..ff769506 100644 --- a/default.py +++ b/default.py @@ -10,6 +10,7 @@ import urlparse import xbmc import xbmcaddon import xbmcgui +import xbmcplugin _addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect') @@ -102,7 +103,6 @@ class Main(): if mode == 'fanart': log.info('User requested fanarttv refresh') utils.window('plex_runLibScan', value='fanart') - return # Called by e.g. 3rd party plugin video extras if ("/Extras" in sys.argv[0] or "/VideoFiles" in sys.argv[0] or @@ -161,21 +161,20 @@ class Main(): "Unable to run the sync, the add-on is not connected " "to a Plex server.") log.error("Not connected to a PMS.") - return - else: if mode == 'repair': utils.window('plex_runLibScan', value="repair") - log.warn("Requesting repair lib sync") + log.info("Requesting repair lib sync") elif mode == 'manualsync': - log.warn("Requesting full library scan") + log.info("Requesting full library scan") utils.window('plex_runLibScan', value="full") elif mode == "texturecache": utils.window('plex_runLibScan', value='del_textures') - else: entrypoint.doMainListing() + # Prevent Kodi from hanging in an infinite loop waiting for more + xbmcplugin.endOfDirectory(int(sys.argv[1])) if __name__ == "__main__": log.info('plugin.video.plexkodiconnect started') diff --git a/resources/lib/artwork.py b/resources/lib/artwork.py index a0652f9e..37cba78d 100644 --- a/resources/lib/artwork.py +++ b/resources/lib/artwork.py @@ -269,7 +269,6 @@ class Artwork(): connection.close() for url in result: self.cacheTexture(url[0]) - log.info('Done throwing URLs to art download daemon') def cacheTexture(self, url): # Cache a single image url to the texture cache