mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Fix watched bug
Try to catch kodi_id returning -1 and try to read the data returned by Kodi in that situation.
This commit is contained in:
parent
c46a64e579
commit
119ecaa39c
1 changed files with 7 additions and 3 deletions
|
@ -92,16 +92,20 @@ class KodiMonitor(xbmc.Monitor):
|
||||||
def _on_play_(self, data):
|
def _on_play_(self, data):
|
||||||
# Set up report progress for emby playback
|
# Set up report progress for emby playback
|
||||||
try:
|
try:
|
||||||
|
kodi_id = None
|
||||||
|
|
||||||
if KODI >= 17:
|
if KODI >= 17:
|
||||||
item = xbmc.Player().getVideoInfoTag()
|
item = xbmc.Player().getVideoInfoTag()
|
||||||
kodi_id = item.getDbId()
|
kodi_id = item.getDbId()
|
||||||
item_type = item.getMediaType()
|
item_type = item.getMediaType()
|
||||||
log.info("kodi_id: %s item_type: %s", kodi_id, item_type)
|
|
||||||
else:
|
if kodi_id is None or int(kodi_id) == -1:
|
||||||
item = data['item']
|
item = data['item']
|
||||||
kodi_id = item['id']
|
kodi_id = item['id']
|
||||||
item_type = item['type']
|
item_type = item['type']
|
||||||
log.info("kodi_id: %s item_type: %s", kodi_id, item_type)
|
|
||||||
|
log.info("kodi_id: %s item_type: %s", kodi_id, item_type)
|
||||||
|
|
||||||
except (KeyError, TypeError):
|
except (KeyError, TypeError):
|
||||||
log.info("Item is invalid for playstate update")
|
log.info("Item is invalid for playstate update")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue