From 68ea41fe246b3a1e7fb856a7e00762acd0873629 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 16 Mar 2016 13:08:55 +0100 Subject: [PATCH] Fix direct path playback not being reported to PMS --- resources/lib/kodimonitor.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 842eeb7a..2adae92d 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -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')