From 1b681a0e9914fde257dc89ae6701fe1c99e331c7 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 4 Apr 2015 05:20:13 -0500 Subject: [PATCH] Revert "Quick fix for UserClient sleep" This reverts commit 281b70da852cdfbcff173db49d9b23ce98cd21dc. --- resources/lib/UserClient.py | 12 +++++------- service.py | 2 -- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/resources/lib/UserClient.py b/resources/lib/UserClient.py index 071471e2..a8834903 100644 --- a/resources/lib/UserClient.py +++ b/resources/lib/UserClient.py @@ -44,6 +44,7 @@ class UserClient(threading.Thread): self.addonName = clientInfo.getAddonName() self.addon = xbmcaddon.Addon(id=self.addonId) + self.logMsg("|---- Starting UserClient ----|", 0) threading.Thread.__init__(self, *args) def logMsg(self, msg, level=1): @@ -290,8 +291,6 @@ class UserClient(threading.Thread): def run(self): - self.logMsg("|---- Starting UserClient ----|", 0) - while not self.KodiMonitor.abortRequested(): # Get the latest addon settings @@ -311,6 +310,7 @@ class UserClient(threading.Thread): self.auth = False self.authenticate() + if (self.auth == False) and (self.currUser == None): # Only if there's information found to login server = self.getServer() @@ -330,11 +330,9 @@ class UserClient(threading.Thread): if self.stopClient == True: break - # Prevent sleep while the initial sync is going - if (self.WINDOW.getProperty("Server_sync") == ""): - if self.KodiMonitor.waitForAbort(1): - # Abort was requested while waiting. We should exit - break + if self.KodiMonitor.waitForAbort(1): + # Abort was requested while waiting. We should exit + break self.logMsg("|---- UserClient Stopped ----|", 0) diff --git a/service.py b/service.py index 217e29ec..d90f26da 100644 --- a/service.py +++ b/service.py @@ -93,14 +93,12 @@ class Service(): #full sync if(cur_seconds_fullsync >= interval_FullSync): xbmc.log("Doing_Db_Sync: syncDatabase (Started)") - self.WINDOW.setProperty("Server_sync", "true") worked = librarySync.syncDatabase() xbmc.log("Doing_Db_Sync: syncDatabase (Finished) " + str(worked)) if(worked): cur_seconds_fullsync = 0 else: cur_seconds_fullsync = interval_FullSync - 10 - self.WINDOW.setProperty("Server_sync", "") else: cur_seconds_fullsync += 1