mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 10:46:11 +00:00
Added some logging
This commit is contained in:
parent
e4c8da2097
commit
d5c9ae5c91
2 changed files with 26 additions and 14 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
|
||||||
|
|
31
service.py
31
service.py
|
@ -27,14 +27,25 @@ class Service():
|
||||||
newUserClient = None
|
newUserClient = None
|
||||||
|
|
||||||
clientInfo = ClientInformation()
|
clientInfo = ClientInformation()
|
||||||
|
addonName = None
|
||||||
|
className = None
|
||||||
|
|
||||||
def __init__(self, *args ):
|
def __init__(self, *args ):
|
||||||
self.KodiMonitor = KodiMonitor.Kodi_Monitor()
|
self.KodiMonitor = KodiMonitor.Kodi_Monitor()
|
||||||
|
self.addonName = self.clientInfo.getAddonName()
|
||||||
|
self.className = self.__class__.__name__
|
||||||
|
|
||||||
utils.logMsg("MB3 Sync Service", "starting Monitor",0)
|
self.logMsg("Starting Monitor", 0)
|
||||||
xbmc.log("======== START %s ========" % self.clientInfo.getAddonName())
|
self.logMsg("======== START %s ========" % self.addonName, 0)
|
||||||
|
self.logMsg("KODI Version: %s" % xbmc.getInfoLabel("System.BuildVersion"), 0)
|
||||||
|
self.logMsg("%s Version: %s" % (self.addonName, self.clientInfo.getVersion()), 0)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def logMsg(self, msg, lvl=1):
|
||||||
|
addonName = self.addonName
|
||||||
|
className = self.className
|
||||||
|
|
||||||
|
utils.logMsg("%s %s" % (addonName, className), str(msg), int(lvl))
|
||||||
|
|
||||||
def ServiceEntryPoint(self):
|
def ServiceEntryPoint(self):
|
||||||
|
|
||||||
|
@ -71,12 +82,12 @@ class Service():
|
||||||
try:
|
try:
|
||||||
player.reportPlayback()
|
player.reportPlayback()
|
||||||
except Exception, msg:
|
except Exception, msg:
|
||||||
xbmc.log("MB3 Sync Service -> Exception reporting progress : " + msg)
|
self.logMsg("Exception reporting progress: %s" % msg)
|
||||||
pass
|
pass
|
||||||
lastProgressUpdate = datetime.today()
|
lastProgressUpdate = datetime.today()
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
xbmc.log("MB3 Sync Service -> Exception in Playback Monitor Service : " + str(e))
|
self.logMsg("Exception in Playback Monitor Service: %s" % e)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if (self.newUserClient == None):
|
if (self.newUserClient == None):
|
||||||
|
@ -92,9 +103,9 @@ 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)")
|
self.logMsg("Doing_Db_Sync: syncDatabase (Started)")
|
||||||
worked = librarySync.syncDatabase()
|
worked = librarySync.syncDatabase()
|
||||||
xbmc.log("Doing_Db_Sync: syncDatabase (Finished) " + str(worked))
|
self.logMsg("Doing_Db_Sync: syncDatabase (Finished) %s" % worked)
|
||||||
if(worked):
|
if(worked):
|
||||||
cur_seconds_fullsync = 0
|
cur_seconds_fullsync = 0
|
||||||
else:
|
else:
|
||||||
|
@ -104,9 +115,9 @@ class Service():
|
||||||
|
|
||||||
#incremental sync
|
#incremental sync
|
||||||
if(cur_seconds_incrsync >= interval_IncrementalSync):
|
if(cur_seconds_incrsync >= interval_IncrementalSync):
|
||||||
xbmc.log("Doing_Db_Sync: updatePlayCounts (Started)")
|
self.logMsg("Doing_Db_Sync: updatePlayCounts (Started)")
|
||||||
worked = librarySync.updatePlayCounts()
|
worked = librarySync.updatePlayCounts()
|
||||||
xbmc.log("Doing_Db_Sync: updatePlayCounts (Finished) " + str(worked))
|
self.logMsg("Doing_Db_Sync: updatePlayCounts (Finished) %s" % worked)
|
||||||
if(worked):
|
if(worked):
|
||||||
cur_seconds_incrsync = 0
|
cur_seconds_incrsync = 0
|
||||||
else:
|
else:
|
||||||
|
@ -116,9 +127,9 @@ class Service():
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
xbmc.log("Not authenticated yet")
|
self.logMsg("Not authenticated yet")
|
||||||
|
|
||||||
utils.logMsg("MB3 Sync Service", "stopping Service",0)
|
self.logMsg("Stopping Service", 0)
|
||||||
|
|
||||||
if (self.newWebSocketThread != None):
|
if (self.newWebSocketThread != None):
|
||||||
ws.stopClient()
|
ws.stopClient()
|
||||||
|
|
Loading…
Reference in a new issue