Fix Kodi TypeError with ListItems

This commit is contained in:
tomkat83 2017-08-02 18:54:05 +02:00
parent 26f0c6e556
commit 64fe064008
2 changed files with 11 additions and 3 deletions

View file

@ -2534,8 +2534,12 @@ class API():
# Expensive operation # Expensive operation
metadata['title'] = title metadata['title'] = title
listItem.setInfo('video', infoLabels=metadata) listItem.setInfo('video', infoLabels=metadata)
# Add context menu entry for information screen try:
listItem.addContextMenuItems([(lang(30018), 'XBMC.Action(Info)',)]) # Add context menu entry for information screen
listItem.addContextMenuItems([(lang(30018), 'XBMC.Action(Info)',)])
except TypeError:
# Kodi fuck-up
pass
return listItem return listItem
def add_video_streams(self, listItem): def add_video_streams(self, listItem):

View file

@ -255,7 +255,11 @@ def createListItem(item, appendShowTitle=False, appendSxxExx=False):
li.setArt({'icon': 'DefaultTVShows.png'}) li.setArt({'icon': 'DefaultTVShows.png'})
li.setProperty('dbid', str(item['episodeid'])) li.setProperty('dbid', str(item['episodeid']))
li.setProperty('fanart_image', item['art'].get('tvshow.fanart','')) 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 key, value in item['streamdetails'].iteritems():
for stream in value: for stream in value:
li.addStreamInfo(key, stream) li.addStreamInfo(key, stream)