From e41cf94cee611624b38f1d175080625e3a920e8e Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 13 Apr 2016 13:30:25 +0200 Subject: [PATCH] Suspend threads when server goes offline --- service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service.py b/service.py index fe3e604d..d5d616ee 100644 --- a/service.py +++ b/service.py @@ -246,6 +246,8 @@ class Service(): if self.server_online: log("Server is offline.", 1) window('emby_online', value="false") + # Suspend threads + window('suspend_LibraryThread', value='true') xbmcgui.Dialog().notification( heading=lang(33001), @@ -274,6 +276,10 @@ class Service(): self.server_online = True log("Server %s is online and ready." % server, 1) window('emby_online', value="true") + if window('plex_authenticated') == 'true': + # Server got offline when we were authenticated. + # Hence resume threads + window('suspend_LibraryThread', clear=True) # Start the userclient thread if not self.userclient_running: