moved some more logging to info or debug level

This commit is contained in:
Marcel van der Veldt 2015-03-20 00:34:56 +01:00
parent e24d20706d
commit 5b65e1cfda
4 changed files with 20 additions and 24 deletions

View file

@ -630,7 +630,6 @@ class LibrarySync():
if type=='Movie': if type=='Movie':
MB3Movie = ReadEmbyDB().getItem(itemID) MB3Movie = ReadEmbyDB().getItem(itemID)
kodiItem = ReadKodiDB().getKodiMovie(itemID) kodiItem = ReadKodiDB().getKodiMovie(itemID)
print MB3Movie
if(self.ShouldStop()): if(self.ShouldStop()):
return True return True

View file

@ -27,7 +27,6 @@ class PlayUtils():
addonSettings = xbmcaddon.Addon(id='plugin.video.mb3sync') addonSettings = xbmcaddon.Addon(id='plugin.video.mb3sync')
# if the path is local and depending on the video quality play we can direct play it do so- # if the path is local and depending on the video quality play we can direct play it do so-
if self.isDirectPlay(result) == True: if self.isDirectPlay(result) == True:
xbmc.log("mb3sync getPlayUrl -> Direct Play")
playurl = result.get("Path") playurl = result.get("Path")
if playurl != None: if playurl != None:
#We have a path to play so play it #We have a path to play so play it
@ -58,7 +57,6 @@ class PlayUtils():
else: else:
#No path or has a path but not sufficient network so transcode #No path or has a path but not sufficient network so transcode
xbmc.log("mb3sync getPlayUrl -> Transcode")
if result.get("Type") == "Audio": if result.get("Type") == "Audio":
playurl = 'http://' + server + '/mediabrowser/Audio/' + id + '/stream.mp3' playurl = 'http://' + server + '/mediabrowser/Audio/' + id + '/stream.mp3'
else: else:
@ -92,14 +90,14 @@ class PlayUtils():
if(mediaSources != None): if(mediaSources != None):
if mediaSources[0].get('Bitrate') != None: if mediaSources[0].get('Bitrate') != None:
if settingsVideoBitRate < int(mediaSources[0].get('Bitrate')): if settingsVideoBitRate < int(mediaSources[0].get('Bitrate')):
xbmc.log("mb3sync isNetworkQualitySufficient -> FALSE bit rate - settingsVideoBitRate: " + str(settingsVideoBitRate) + " mediasource bitrate: " + str(mediaSources[0].get('Bitrate'))) #xbmc.log("mb3sync isNetworkQualitySufficient -> FALSE bit rate - settingsVideoBitRate: " + str(settingsVideoBitRate) + " mediasource bitrate: " + str(mediaSources[0].get('Bitrate')))
return False return False
else: else:
xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE bit rate") #xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE bit rate")
return True return True
# Any thing else is ok # Any thing else is ok
xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE default") #xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE default")
return True return True

View file

@ -56,7 +56,6 @@ class PlaybackUtils():
playurl = PlayUtils().getPlayUrl(server, id, result) playurl = PlayUtils().getPlayUrl(server, id, result)
xbmc.log("Play URL: " + playurl)
thumbPath = API().getArtwork(result, "Primary") thumbPath = API().getArtwork(result, "Primary")
listItem = xbmcgui.ListItem(path=playurl, iconImage=thumbPath, thumbnailImage=thumbPath) listItem = xbmcgui.ListItem(path=playurl, iconImage=thumbPath, thumbnailImage=thumbPath)

View file

@ -31,7 +31,7 @@ class Player( xbmc.Player ):
self.logLevel = int(self.settings.getSetting('logLevel')) self.logLevel = int(self.settings.getSetting('logLevel'))
except: except:
pass pass
self.printDebug("mb3sync Service -> starting playback monitor service") self.printDebug("mb3sync Service -> starting playback monitor service",1)
self.played_information = {} self.played_information = {}
pass pass
@ -51,7 +51,7 @@ class Player( xbmc.Player ):
def deleteItem (self, url): def deleteItem (self, url):
return_value = xbmcgui.Dialog().yesno(__language__(30091),__language__(30092)) return_value = xbmcgui.Dialog().yesno(__language__(30091),__language__(30092))
if return_value: if return_value:
self.printDebug('Deleting via URL: ' + url) self.printDebug('Deleting via URL: ' + url,1)
progress = xbmcgui.DialogProgress() progress = xbmcgui.DialogProgress()
progress.create(__language__(30052), __language__(30053)) progress.create(__language__(30052), __language__(30053))
self.downloadUtils.downloadUrl(url, type="DELETE") self.downloadUtils.downloadUrl(url, type="DELETE")
@ -79,8 +79,8 @@ class Player( xbmc.Player ):
data = self.played_information.get(item_url) data = self.played_information.get(item_url)
if(data != None): if(data != None):
self.printDebug("mb3sync Service -> item_url : " + item_url) self.printDebug("mb3sync Service -> item_url : " + item_url,2)
self.printDebug("mb3sync Service -> item_data : " + str(data)) self.printDebug("mb3sync Service -> item_data : " + str(data),2)
deleteurl = data.get("deleteurl") deleteurl = data.get("deleteurl")
runtime = data.get("runtime") runtime = data.get("runtime")
@ -96,17 +96,17 @@ class Player( xbmc.Player ):
if(currentPosition != None and self.hasData(runtime)): if(currentPosition != None and self.hasData(runtime)):
runtimeTicks = int(runtime) runtimeTicks = int(runtime)
self.printDebug("mb3sync Service -> runtimeticks:" + str(runtimeTicks)) self.printDebug("mb3sync Service -> runtimeticks:" + str(runtimeTicks),2)
percentComplete = (currentPosition * 10000000) / runtimeTicks percentComplete = (currentPosition * 10000000) / runtimeTicks
markPlayedAt = float(90) / 100 markPlayedAt = float(90) / 100
self.printDebug("mb3sync Service -> Percent Complete:" + str(percentComplete) + " Mark Played At:" + str(markPlayedAt)) self.printDebug("mb3sync Service -> Percent Complete:" + str(percentComplete) + " Mark Played At:" + str(markPlayedAt),2)
self.stopPlayback(data) self.stopPlayback(data)
if (percentComplete > markPlayedAt): if (percentComplete > markPlayedAt):
gotDeleted = 0 gotDeleted = 0
if(deleteurl != None and deleteurl != ""): if(deleteurl != None and deleteurl != ""):
self.printDebug("mb3sync Service -> Offering Delete:" + str(deleteurl)) self.printDebug("mb3sync Service -> Offering Delete:" + str(deleteurl),2)
gotDeleted = self.deleteItem(deleteurl) gotDeleted = self.deleteItem(deleteurl)
@ -148,7 +148,7 @@ class Player( xbmc.Player ):
def reportPlayback(self): def reportPlayback(self):
self.printDebug("reportPlayback Called") self.printDebug("reportPlayback Called",2)
currentFile = xbmc.Player().getPlayingFile() currentFile = xbmc.Player().getPlayingFile()
@ -192,20 +192,20 @@ class Player( xbmc.Player ):
def onPlayBackPaused( self ): def onPlayBackPaused( self ):
currentFile = xbmc.Player().getPlayingFile() currentFile = xbmc.Player().getPlayingFile()
self.printDebug("PLAYBACK_PAUSED : " + currentFile) self.printDebug("PLAYBACK_PAUSED : " + currentFile,2)
if(self.played_information.get(currentFile) != None): if(self.played_information.get(currentFile) != None):
self.played_information[currentFile]["paused"] = "true" self.played_information[currentFile]["paused"] = "true"
self.reportPlayback() self.reportPlayback()
def onPlayBackResumed( self ): def onPlayBackResumed( self ):
currentFile = xbmc.Player().getPlayingFile() currentFile = xbmc.Player().getPlayingFile()
self.printDebug("PLAYBACK_RESUMED : " + currentFile) self.printDebug("PLAYBACK_RESUMED : " + currentFile,2)
if(self.played_information.get(currentFile) != None): if(self.played_information.get(currentFile) != None):
self.played_information[currentFile]["paused"] = "false" self.played_information[currentFile]["paused"] = "false"
self.reportPlayback() self.reportPlayback()
def onPlayBackSeek( self, time, seekOffset ): def onPlayBackSeek( self, time, seekOffset ):
self.printDebug("PLAYBACK_SEEK") self.printDebug("PLAYBACK_SEEK",2)
self.reportPlayback() self.reportPlayback()
def onPlayBackStarted( self ): def onPlayBackStarted( self ):
@ -216,7 +216,7 @@ class Player( xbmc.Player ):
if xbmc.Player().isPlaying(): if xbmc.Player().isPlaying():
currentFile = xbmc.Player().getPlayingFile() currentFile = xbmc.Player().getPlayingFile()
self.printDebug("mb3sync Service -> onPlayBackStarted" + currentFile) self.printDebug("mb3sync Service -> onPlayBackStarted" + currentFile,2)
# grab all the info about this item from the stored windows props # grab all the info about this item from the stored windows props
# only ever use the win props here, use the data map in all other places # only ever use the win props here, use the data map in all other places
@ -265,8 +265,8 @@ class Player( xbmc.Player ):
data["Type"] = itemType data["Type"] = itemType
self.played_information[currentFile] = data self.played_information[currentFile] = data
self.printDebug("mb3sync Service -> ADDING_FILE : " + currentFile) self.printDebug("mb3sync Service -> ADDING_FILE : " + currentFile,2)
self.printDebug("mb3sync Service -> ADDING_FILE : " + str(self.played_information)) self.printDebug("mb3sync Service -> ADDING_FILE : " + str(self.played_information),2)
# log some playback stats # log some playback stats
if(itemType != None): if(itemType != None):
@ -291,12 +291,12 @@ class Player( xbmc.Player ):
def onPlayBackEnded( self ): def onPlayBackEnded( self ):
# Will be called when xbmc stops playing a file # Will be called when xbmc stops playing a file
self.printDebug("mb3sync Service -> onPlayBackEnded") self.printDebug("mb3sync Service -> onPlayBackEnded",2)
self.stopAll() self.stopAll()
def onPlayBackStopped( self ): def onPlayBackStopped( self ):
# Will be called when user stops xbmc playing a file # Will be called when user stops xbmc playing a file
self.printDebug("mb3sync Service -> onPlayBackStopped") self.printDebug("mb3sync Service -> onPlayBackStopped",2)
self.stopAll() self.stopAll()
def seekToPosition(self, seekTo): def seekToPosition(self, seekTo):