From c46a64e5796167c125aaffdc6ed8a316b71bd683 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sun, 7 May 2017 18:19:55 -0500 Subject: [PATCH] Revert "Fix watched bug" This reverts commit b3aca0542eebb7acc2b8ebc90fdbc98ced55e812. --- resources/lib/kodimonitor.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 26301692..9c1d6a5f 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -92,10 +92,16 @@ class KodiMonitor(xbmc.Monitor): def _on_play_(self, data): # Set up report progress for emby playback try: - item = data['item'] - kodi_id = item['id'] - item_type = item['type'] - log.info("kodi_id: %s item_type: %s", kodi_id, item_type) + if KODI >= 17: + item = xbmc.Player().getVideoInfoTag() + kodi_id = item.getDbId() + item_type = item.getMediaType() + log.info("kodi_id: %s item_type: %s", kodi_id, item_type) + else: + item = data['item'] + kodi_id = item['id'] + item_type = item['type'] + log.info("kodi_id: %s item_type: %s", kodi_id, item_type) except (KeyError, TypeError): log.info("Item is invalid for playstate update") else: