From 984873060a05eedbbd43e21a58936a673414d571 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Tue, 18 Oct 2016 22:17:00 -0500 Subject: [PATCH] Prepare for Krypton listitem --- resources/lib/playbackutils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index 0d7dfa76..037b45bf 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -64,6 +64,8 @@ class PlaybackUtils(): self.setProperties(playurl, listitem) return xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) + # TODO: Review once Krypton is RC, no need for workaround. + ############### ORGANIZE CURRENT PLAYLIST ################ homeScreen = xbmc.getCondVisibility('Window.IsActive(home)') @@ -344,7 +346,7 @@ class PlaybackUtils(): else: listItem.setArt({arttype: path}) - def setListItem(self, listItem): + def setListItem(self, listItem, dbid=None): people = self.API.get_people() studios = self.API.get_studios() @@ -366,6 +368,10 @@ class PlaybackUtils(): if "Episode" in self.item['Type']: # Only for tv shows + # For Kodi Krypton + metadata['mediatype'] = "episode" + metadata['dbid'] = dbid + thumbId = self.item.get('SeriesId') season = self.item.get('ParentIndexNumber', -1) episode = self.item.get('IndexNumber', -1) @@ -375,6 +381,11 @@ class PlaybackUtils(): metadata['season'] = season metadata['episode'] = episode + if "Movie" in self.item['Type']: + # For Kodi Krypton + metadata['mediatype'] = "movie" + metadata['dbid'] = dbid + listItem.setProperty('IsPlayable', 'true') listItem.setProperty('IsFolder', 'false') listItem.setLabel(metadata['title'])