Prepare for Krypton listitem

This commit is contained in:
angelblue05 2016-10-18 22:17:00 -05:00
parent 9d5980d08a
commit 984873060a

View file

@ -64,6 +64,8 @@ class PlaybackUtils():
self.setProperties(playurl, listitem) self.setProperties(playurl, listitem)
return xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) return xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
# TODO: Review once Krypton is RC, no need for workaround.
############### ORGANIZE CURRENT PLAYLIST ################ ############### ORGANIZE CURRENT PLAYLIST ################
homeScreen = xbmc.getCondVisibility('Window.IsActive(home)') homeScreen = xbmc.getCondVisibility('Window.IsActive(home)')
@ -344,7 +346,7 @@ class PlaybackUtils():
else: else:
listItem.setArt({arttype: path}) listItem.setArt({arttype: path})
def setListItem(self, listItem): def setListItem(self, listItem, dbid=None):
people = self.API.get_people() people = self.API.get_people()
studios = self.API.get_studios() studios = self.API.get_studios()
@ -366,6 +368,10 @@ class PlaybackUtils():
if "Episode" in self.item['Type']: if "Episode" in self.item['Type']:
# Only for tv shows # Only for tv shows
# For Kodi Krypton
metadata['mediatype'] = "episode"
metadata['dbid'] = dbid
thumbId = self.item.get('SeriesId') thumbId = self.item.get('SeriesId')
season = self.item.get('ParentIndexNumber', -1) season = self.item.get('ParentIndexNumber', -1)
episode = self.item.get('IndexNumber', -1) episode = self.item.get('IndexNumber', -1)
@ -375,6 +381,11 @@ class PlaybackUtils():
metadata['season'] = season metadata['season'] = season
metadata['episode'] = episode metadata['episode'] = episode
if "Movie" in self.item['Type']:
# For Kodi Krypton
metadata['mediatype'] = "movie"
metadata['dbid'] = dbid
listItem.setProperty('IsPlayable', 'true') listItem.setProperty('IsPlayable', 'true')
listItem.setProperty('IsFolder', 'false') listItem.setProperty('IsFolder', 'false')
listItem.setLabel(metadata['title']) listItem.setLabel(metadata['title'])