From 7eaaa933b7d0ca8f0f5b4ba389602adebbb69aa8 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 1 Nov 2018 01:39:44 -0500 Subject: [PATCH] Fix dynamic widgets --- resources/lib/entrypoint/default.py | 14 +++++++++++--- resources/lib/helper/utils.py | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/lib/entrypoint/default.py b/resources/lib/entrypoint/default.py index 2298cd2f..b32965b3 100644 --- a/resources/lib/entrypoint/default.py +++ b/resources/lib/entrypoint/default.py @@ -229,9 +229,18 @@ def browse(media, view_id=None, folder=None, server_id=None): LOG.info("--[ v:%s/%s ] %s", view_id, media, folder) if not window('emby_online.bool') and server_id is None: - LOG.error("Default server is not online.") - return + monitor = xbmc.Monitor() + + for i in range(300): + if window('emby_online.bool'): + break + elif monitor.waitForAbort(0.1): + return + else: + LOG.error("Default server is not online.") + + return folder = folder.lower() if folder else None @@ -376,7 +385,6 @@ def browse(media, view_id=None, folder=None, server_id=None): xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) - LOG.info(content_type) xbmcplugin.setContent(int(sys.argv[1]), content_type) xbmcplugin.endOfDirectory(int(sys.argv[1])) diff --git a/resources/lib/helper/utils.py b/resources/lib/helper/utils.py index 2d51d6c6..b20bdd5f 100644 --- a/resources/lib/helper/utils.py +++ b/resources/lib/helper/utils.py @@ -51,7 +51,7 @@ def window(key, value=None, clear=False, window_id=10000): key = key.replace('.bool', "") value = "true" if value else "false" - window.setProperty(key, value) + window.setProperty(key.replace('.json', "").replace('.bool', ""), value) else: result = window.getProperty(key.replace('.json', "").replace('.bool', ""))