From 5b65e1cfda1dc0b21a9bc2375cf647cd0234bca0 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Fri, 20 Mar 2015 00:34:56 +0100 Subject: [PATCH] moved some more logging to info or debug level --- resources/lib/LibrarySync.py | 3 +-- resources/lib/PlayUtils.py | 8 +++----- resources/lib/PlaybackUtils.py | 1 - resources/lib/Player.py | 32 ++++++++++++++++---------------- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index f3fc32aa..b6677aa5 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -629,8 +629,7 @@ class LibrarySync(): #process movie if type=='Movie': MB3Movie = ReadEmbyDB().getItem(itemID) - kodiItem = ReadKodiDB().getKodiMovie(itemID) - print MB3Movie + kodiItem = ReadKodiDB().getKodiMovie(itemID) if(self.ShouldStop()): return True diff --git a/resources/lib/PlayUtils.py b/resources/lib/PlayUtils.py index 7e448118..4058c5ec 100644 --- a/resources/lib/PlayUtils.py +++ b/resources/lib/PlayUtils.py @@ -27,7 +27,6 @@ class PlayUtils(): 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 self.isDirectPlay(result) == True: - xbmc.log("mb3sync getPlayUrl -> Direct Play") playurl = result.get("Path") if playurl != None: #We have a path to play so play it @@ -58,7 +57,6 @@ class PlayUtils(): else: #No path or has a path but not sufficient network so transcode - xbmc.log("mb3sync getPlayUrl -> Transcode") if result.get("Type") == "Audio": playurl = 'http://' + server + '/mediabrowser/Audio/' + id + '/stream.mp3' else: @@ -92,14 +90,14 @@ class PlayUtils(): if(mediaSources != None): if mediaSources[0].get('Bitrate') != None: 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 else: - xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE bit rate") + #xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE bit rate") return True # Any thing else is ok - xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE default") + #xbmc.log("mb3sync isNetworkQualitySufficient -> TRUE default") return True diff --git a/resources/lib/PlaybackUtils.py b/resources/lib/PlaybackUtils.py index 1680388f..3b6dc4eb 100644 --- a/resources/lib/PlaybackUtils.py +++ b/resources/lib/PlaybackUtils.py @@ -56,7 +56,6 @@ class PlaybackUtils(): playurl = PlayUtils().getPlayUrl(server, id, result) - xbmc.log("Play URL: " + playurl) thumbPath = API().getArtwork(result, "Primary") listItem = xbmcgui.ListItem(path=playurl, iconImage=thumbPath, thumbnailImage=thumbPath) diff --git a/resources/lib/Player.py b/resources/lib/Player.py index c414d55e..3a7dbab0 100644 --- a/resources/lib/Player.py +++ b/resources/lib/Player.py @@ -31,7 +31,7 @@ class Player( xbmc.Player ): self.logLevel = int(self.settings.getSetting('logLevel')) except: pass - self.printDebug("mb3sync Service -> starting playback monitor service") + self.printDebug("mb3sync Service -> starting playback monitor service",1) self.played_information = {} pass @@ -51,7 +51,7 @@ class Player( xbmc.Player ): def deleteItem (self, url): return_value = xbmcgui.Dialog().yesno(__language__(30091),__language__(30092)) if return_value: - self.printDebug('Deleting via URL: ' + url) + self.printDebug('Deleting via URL: ' + url,1) progress = xbmcgui.DialogProgress() progress.create(__language__(30052), __language__(30053)) self.downloadUtils.downloadUrl(url, type="DELETE") @@ -79,8 +79,8 @@ class Player( xbmc.Player ): data = self.played_information.get(item_url) if(data != None): - self.printDebug("mb3sync Service -> item_url : " + item_url) - self.printDebug("mb3sync Service -> item_data : " + str(data)) + self.printDebug("mb3sync Service -> item_url : " + item_url,2) + self.printDebug("mb3sync Service -> item_data : " + str(data),2) deleteurl = data.get("deleteurl") runtime = data.get("runtime") @@ -96,17 +96,17 @@ class Player( xbmc.Player ): if(currentPosition != None and self.hasData(runtime)): runtimeTicks = int(runtime) - self.printDebug("mb3sync Service -> runtimeticks:" + str(runtimeTicks)) + self.printDebug("mb3sync Service -> runtimeticks:" + str(runtimeTicks),2) percentComplete = (currentPosition * 10000000) / runtimeTicks 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) if (percentComplete > markPlayedAt): gotDeleted = 0 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) @@ -148,7 +148,7 @@ class Player( xbmc.Player ): def reportPlayback(self): - self.printDebug("reportPlayback Called") + self.printDebug("reportPlayback Called",2) currentFile = xbmc.Player().getPlayingFile() @@ -192,20 +192,20 @@ class Player( xbmc.Player ): def onPlayBackPaused( self ): currentFile = xbmc.Player().getPlayingFile() - self.printDebug("PLAYBACK_PAUSED : " + currentFile) + self.printDebug("PLAYBACK_PAUSED : " + currentFile,2) if(self.played_information.get(currentFile) != None): self.played_information[currentFile]["paused"] = "true" self.reportPlayback() def onPlayBackResumed( self ): currentFile = xbmc.Player().getPlayingFile() - self.printDebug("PLAYBACK_RESUMED : " + currentFile) + self.printDebug("PLAYBACK_RESUMED : " + currentFile,2) if(self.played_information.get(currentFile) != None): self.played_information[currentFile]["paused"] = "false" self.reportPlayback() def onPlayBackSeek( self, time, seekOffset ): - self.printDebug("PLAYBACK_SEEK") + self.printDebug("PLAYBACK_SEEK",2) self.reportPlayback() def onPlayBackStarted( self ): @@ -216,7 +216,7 @@ class Player( xbmc.Player ): if xbmc.Player().isPlaying(): 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 # 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 self.played_information[currentFile] = data - self.printDebug("mb3sync Service -> ADDING_FILE : " + currentFile) - self.printDebug("mb3sync Service -> ADDING_FILE : " + str(self.played_information)) + self.printDebug("mb3sync Service -> ADDING_FILE : " + currentFile,2) + self.printDebug("mb3sync Service -> ADDING_FILE : " + str(self.played_information),2) # log some playback stats if(itemType != None): @@ -291,12 +291,12 @@ class Player( xbmc.Player ): def onPlayBackEnded( self ): # Will be called when xbmc stops playing a file - self.printDebug("mb3sync Service -> onPlayBackEnded") + self.printDebug("mb3sync Service -> onPlayBackEnded",2) self.stopAll() def onPlayBackStopped( self ): # Will be called when user stops xbmc playing a file - self.printDebug("mb3sync Service -> onPlayBackStopped") + self.printDebug("mb3sync Service -> onPlayBackStopped",2) self.stopAll() def seekToPosition(self, seekTo):