From de527327a5341a9f4f363df7fbc053a02658e386 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Tue, 12 May 2015 03:16:34 -0500 Subject: [PATCH] Another follow up Use a while loop instead. --- resources/lib/DownloadUtils.py | 2 +- service.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/resources/lib/DownloadUtils.py b/resources/lib/DownloadUtils.py index c6a6fc32..1ed17c6f 100644 --- a/resources/lib/DownloadUtils.py +++ b/resources/lib/DownloadUtils.py @@ -269,7 +269,7 @@ class DownloadUtils(): if r.headers['X-Application-Error-Code'] == "ParentalControl": # Parental control - access restricted WINDOW.setProperty("Server_status", "restricted") - xbmcgui.Dialog().notification("Emby server", "Access restricted.", xbmcgui.NOTIFICATION_ERROR) + xbmcgui.Dialog().notification("Emby server", "Access restricted.", xbmcgui.NOTIFICATION_ERROR, time=5000) return False elif (status == "401") or (status == "Auth"): diff --git a/service.py b/service.py index 1919cb63..60d66b4f 100644 --- a/service.py +++ b/service.py @@ -145,11 +145,18 @@ class Service(): break #WebSocketThread().processPendingActions() else: - user.hasAccess() + if self.warn_auth: self.logMsg("Not authenticated yet.", 1) self.warn_auth = False + while user.HasAccess == False: + user.hasAccess() + if self.KodiMonitor.waitForAbort(5): + # Abort was requested while waiting. We should exit + break + + else: # Wait until server becomes online or shut down is requested while not self.KodiMonitor.abortRequested():