Fix direct path playback not being reported to PMS

This commit is contained in:
tomkat83 2016-03-16 13:08:55 +01:00
parent 769b741060
commit 68ea41fe24

View file

@ -87,8 +87,17 @@ class KodiMonitor(xbmc.Monitor):
except TypeError:
self.logMsg("No kodiid returned.", 1)
else:
# Tell everyone else what's going on
utils.window('Plex_currently_playing_itemid',
value=itemid)
url = "{server}/library/metadata/%s" % itemid
result = doUtils.downloadUrl(url)
try:
result.attrib
except AttributeError:
self.logMsg('Could not retrieve PMS xml for %s'
% itemid, -1)
return
playurl = None
count = 0
while not playurl and count < 2:
@ -110,6 +119,10 @@ class KodiMonitor(xbmc.Monitor):
# Set properties for player.py
playback.setProperties(playurl, listItem)
elif method == "Player.OnStop":
# Get rid of some values
utils.window('Plex_currently_playing_itemid', clear=True)
elif method == "VideoLibrary.OnUpdate":
# Manually marking as watched/unwatched
playcount = data.get('playcount')