From 64fe06400833cdf54d7743d47a32e294f3a4dc1a Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 2 Aug 2017 18:54:05 +0200 Subject: [PATCH] Fix Kodi TypeError with ListItems --- resources/lib/PlexAPI.py | 8 ++++++-- resources/lib/entrypoint.py | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 6b8773cd..930c2e1c 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -2534,8 +2534,12 @@ class API(): # Expensive operation metadata['title'] = title listItem.setInfo('video', infoLabels=metadata) - # Add context menu entry for information screen - listItem.addContextMenuItems([(lang(30018), 'XBMC.Action(Info)',)]) + try: + # Add context menu entry for information screen + listItem.addContextMenuItems([(lang(30018), 'XBMC.Action(Info)',)]) + except TypeError: + # Kodi fuck-up + pass return listItem def add_video_streams(self, listItem): diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index a72d3a9c..2c83ba1d 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -255,7 +255,11 @@ def createListItem(item, appendShowTitle=False, appendSxxExx=False): li.setArt({'icon': 'DefaultTVShows.png'}) li.setProperty('dbid', str(item['episodeid'])) li.setProperty('fanart_image', item['art'].get('tvshow.fanart','')) - li.addContextMenuItems([(lang(30018), 'XBMC.Action(Info)',)]) + try: + li.addContextMenuItems([(lang(30018), 'XBMC.Action(Info)',)]) + except TypeError: + # Kodi fuck-up + pass for key, value in item['streamdetails'].iteritems(): for stream in value: li.addStreamInfo(key, stream)