Updated logging
This commit is contained in:
parent
0f14019e5b
commit
02fa0eb7cb
3 changed files with 16 additions and 5 deletions
|
@ -72,10 +72,13 @@ class PlaybackUtils():
|
||||||
# Close DB
|
# Close DB
|
||||||
embyconn.close()
|
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
|
# Kick off playback
|
||||||
if startPlayer:
|
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)
|
self.logMsg("Starting position: %s" % self.startPos, 1)
|
||||||
Player = xbmc.Player()
|
Player = xbmc.Player()
|
||||||
Player.play(self.playlist, startpos=self.startPos)
|
Player.play(self.playlist, startpos=self.startPos)
|
||||||
|
@ -85,10 +88,12 @@ class PlaybackUtils():
|
||||||
except:
|
except:
|
||||||
self.logMsg("Error, could not resume", -1)
|
self.logMsg("Error, could not resume", -1)
|
||||||
else:
|
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
|
# Delete the last playlist item because we have added it already
|
||||||
filename = self.playlist[-1].getfilename()
|
filename = self.playlist[-1].getfilename()
|
||||||
self.playlist.remove(filename)
|
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])
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitems[0])
|
||||||
|
|
||||||
def AddMediaItemToPlaylist(self, item, emby_db):
|
def AddMediaItemToPlaylist(self, item, emby_db):
|
||||||
|
|
|
@ -164,7 +164,8 @@ class Playlist():
|
||||||
'method': "Playlist.GetItems",
|
'method': "Playlist.GetItems",
|
||||||
'params': {
|
'params': {
|
||||||
|
|
||||||
'playlistid': 1
|
'playlistid': 1,
|
||||||
|
'properties': ['title', 'file']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = xbmc.executeJSONRPC(json.dumps(pl))
|
result = xbmc.executeJSONRPC(json.dumps(pl))
|
||||||
|
|
|
@ -156,11 +156,16 @@ class PlayUtils():
|
||||||
Returns True if we need to transcode
|
Returns True if we need to transcode
|
||||||
"""
|
"""
|
||||||
videoCodec = self.API.getVideoCodec()
|
videoCodec = self.API.getVideoCodec()
|
||||||
|
self.logMsg("videoCodec: %s" % videoCodec, 2)
|
||||||
codec = videoCodec['videocodec']
|
codec = videoCodec['videocodec']
|
||||||
resolution = videoCodec['resolution']
|
resolution = videoCodec['resolution']
|
||||||
h265 = self.getH265()
|
h265 = self.getH265()
|
||||||
|
try:
|
||||||
if not ('h265' in codec or 'hevc' in codec) or (h265 is None):
|
if not ('h265' in codec or 'hevc' in codec) or (h265 is None):
|
||||||
return False
|
return False
|
||||||
|
# E.g. trailers without a codec of None
|
||||||
|
except TypeError:
|
||||||
|
return False
|
||||||
|
|
||||||
if resolution >= h265:
|
if resolution >= h265:
|
||||||
self.logMsg("Option to transcode h265 enabled. Resolution media: "
|
self.logMsg("Option to transcode h265 enabled. Resolution media: "
|
||||||
|
|
Loading…
Reference in a new issue