From 2677f9801236843ffb1d19713eb9b78c70a95cf1 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 13 Sep 2018 01:26:49 -0500 Subject: [PATCH] Fix kodi hang on exit --- resources/lib/downloader.py | 4 +++- resources/lib/entrypoint/default.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/lib/downloader.py b/resources/lib/downloader.py index 02a41137..e6b4e16a 100644 --- a/resources/lib/downloader.py +++ b/resources/lib/downloader.py @@ -288,7 +288,9 @@ class TheVoid(object): return response - if xbmc.Monitor().abortRequested(): + if window('emby_should_stop.bool'): + LOG.info("Abandon mission! A black hole just swallowed [ %s ]", self.data['VoidName']) + break def get_objects(src, filename): diff --git a/resources/lib/entrypoint/default.py b/resources/lib/entrypoint/default.py index f4ab6869..5e6d094f 100644 --- a/resources/lib/entrypoint/default.py +++ b/resources/lib/entrypoint/default.py @@ -215,6 +215,11 @@ 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 + if view_id: view = TheVoid('GetItem', {'ServerId': server_id, 'Id': view_id}).get()