mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 10:46:11 +00:00
Quick fix for UserClient sleep
It was activating sleep while the initial scan was going. Changed to allow sleep when the initial scan is not running.
This commit is contained in:
parent
3ed9024e61
commit
281b70da85
2 changed files with 9 additions and 5 deletions
|
@ -44,7 +44,6 @@ class UserClient(threading.Thread):
|
||||||
self.addonName = clientInfo.getAddonName()
|
self.addonName = clientInfo.getAddonName()
|
||||||
self.addon = xbmcaddon.Addon(id=self.addonId)
|
self.addon = xbmcaddon.Addon(id=self.addonId)
|
||||||
|
|
||||||
self.logMsg("|---- Starting UserClient ----|", 0)
|
|
||||||
threading.Thread.__init__(self, *args)
|
threading.Thread.__init__(self, *args)
|
||||||
|
|
||||||
def logMsg(self, msg, level=1):
|
def logMsg(self, msg, level=1):
|
||||||
|
@ -291,6 +290,8 @@ class UserClient(threading.Thread):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
self.logMsg("|---- Starting UserClient ----|", 0)
|
||||||
|
|
||||||
while not self.KodiMonitor.abortRequested():
|
while not self.KodiMonitor.abortRequested():
|
||||||
|
|
||||||
# Get the latest addon settings
|
# Get the latest addon settings
|
||||||
|
@ -310,7 +311,6 @@ class UserClient(threading.Thread):
|
||||||
self.auth = False
|
self.auth = False
|
||||||
self.authenticate()
|
self.authenticate()
|
||||||
|
|
||||||
|
|
||||||
if (self.auth == False) and (self.currUser == None):
|
if (self.auth == False) and (self.currUser == None):
|
||||||
# Only if there's information found to login
|
# Only if there's information found to login
|
||||||
server = self.getServer()
|
server = self.getServer()
|
||||||
|
@ -330,9 +330,11 @@ class UserClient(threading.Thread):
|
||||||
if self.stopClient == True:
|
if self.stopClient == True:
|
||||||
break
|
break
|
||||||
|
|
||||||
if self.KodiMonitor.waitForAbort(1):
|
# Prevent sleep while the initial sync is going
|
||||||
# Abort was requested while waiting. We should exit
|
if (self.WINDOW.getProperty("Server_sync") == ""):
|
||||||
break
|
if self.KodiMonitor.waitForAbort(1):
|
||||||
|
# Abort was requested while waiting. We should exit
|
||||||
|
break
|
||||||
|
|
||||||
self.logMsg("|---- UserClient Stopped ----|", 0)
|
self.logMsg("|---- UserClient Stopped ----|", 0)
|
||||||
|
|
||||||
|
|
|
@ -93,12 +93,14 @@ class Service():
|
||||||
#full sync
|
#full sync
|
||||||
if(cur_seconds_fullsync >= interval_FullSync):
|
if(cur_seconds_fullsync >= interval_FullSync):
|
||||||
xbmc.log("Doing_Db_Sync: syncDatabase (Started)")
|
xbmc.log("Doing_Db_Sync: syncDatabase (Started)")
|
||||||
|
self.WINDOW.setProperty("Server_sync", "true")
|
||||||
worked = librarySync.syncDatabase()
|
worked = librarySync.syncDatabase()
|
||||||
xbmc.log("Doing_Db_Sync: syncDatabase (Finished) " + str(worked))
|
xbmc.log("Doing_Db_Sync: syncDatabase (Finished) " + str(worked))
|
||||||
if(worked):
|
if(worked):
|
||||||
cur_seconds_fullsync = 0
|
cur_seconds_fullsync = 0
|
||||||
else:
|
else:
|
||||||
cur_seconds_fullsync = interval_FullSync - 10
|
cur_seconds_fullsync = interval_FullSync - 10
|
||||||
|
self.WINDOW.setProperty("Server_sync", "")
|
||||||
else:
|
else:
|
||||||
cur_seconds_fullsync += 1
|
cur_seconds_fullsync += 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue