Updated logging

This commit is contained in:
tomkat83 2016-02-07 13:26:28 +01:00
parent 0f14019e5b
commit 02fa0eb7cb
3 changed files with 16 additions and 5 deletions

View file

@ -72,10 +72,13 @@ class PlaybackUtils():
# Close DB
embyconn.close()
self.logMsg("Playlist size now: %s" % self.playlist.size(), 1)
self.logMsg("Playlist size now: %s. Files before deletion:"
% self.playlist.size(), 2)
for i in range(self.playlist.size()):
self.logMsg(self.playlist[i].getfilename(), 2)
# Kick off playback
if startPlayer:
self.logMsg("Starting up a new xbmc.Player() instance", 1)
self.logMsg("Starting up a new xbmc.Player() instance", 2)
self.logMsg("Starting position: %s" % self.startPos, 1)
Player = xbmc.Player()
Player.play(self.playlist, startpos=self.startPos)
@ -85,10 +88,12 @@ class PlaybackUtils():
except:
self.logMsg("Error, could not resume", -1)
else:
self.logMsg("xbmc.Player() instance already up", 1)
self.logMsg("xbmc.Player() instance already up. Files playing:", 2)
# Delete the last playlist item because we have added it already
filename = self.playlist[-1].getfilename()
self.playlist.remove(filename)
for i in range(self.playlist.size()):
self.logMsg(self.playlist[i].getfilename(), 2)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitems[0])
def AddMediaItemToPlaylist(self, item, emby_db):

View file

@ -164,7 +164,8 @@ class Playlist():
'method': "Playlist.GetItems",
'params': {
'playlistid': 1
'playlistid': 1,
'properties': ['title', 'file']
}
}
result = xbmc.executeJSONRPC(json.dumps(pl))

View file

@ -156,10 +156,15 @@ class PlayUtils():
Returns True if we need to transcode
"""
videoCodec = self.API.getVideoCodec()
self.logMsg("videoCodec: %s" % videoCodec, 2)
codec = videoCodec['videocodec']
resolution = videoCodec['resolution']
h265 = self.getH265()
if not ('h265' in codec or 'hevc' in codec) or (h265 is None):
try:
if not ('h265' in codec or 'hevc' in codec) or (h265 is None):
return False
# E.g. trailers without a codec of None
except TypeError:
return False
if resolution >= h265: