From f8bf3b515128a76831f2c9386d1be02f55855f8f Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 15 Oct 2018 06:40:28 -0500 Subject: [PATCH] Krypton update to support upnext --- resources/lib/objects/__init__.py | 2 +- resources/lib/objects/actions.py | 11 +++++++++++ resources/lib/objects/obj.py | 4 ++-- resources/lib/objects/obj_map.json | 12 ++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/resources/lib/objects/__init__.py b/resources/lib/objects/__init__.py index 2c2dcac9..6cf757ac 100644 --- a/resources/lib/objects/__init__.py +++ b/resources/lib/objects/__init__.py @@ -1,4 +1,4 @@ -version = "171076021" +version = "171076022" from movies import Movies from musicvideos import MusicVideos diff --git a/resources/lib/objects/actions.py b/resources/lib/objects/actions.py index aaae665c..e9ba96a0 100644 --- a/resources/lib/objects/actions.py +++ b/resources/lib/objects/actions.py @@ -256,6 +256,17 @@ class Actions(object): LOG.info("[ subtitles ] %s", item['PlaybackInfo']['SubtitleUrl']) listitem.setSubtitles([item['PlaybackInfo']['SubtitleUrl']]) + if item['Type'] == 'Episode': + + item['PlaybackInfo']['CurrentEpisode'] = objects.map(item, "UpNext") + item['PlaybackInfo']['CurrentEpisode']['art'] = { + 'tvshow.poster': obj['Artwork'].get('Series.Primary'), + 'thumb': obj['Artwork'].get('Primary'), + 'tvshow.fanart': None + } + if obj['Artwork']['Backdrop']: + item['PlaybackInfo']['CurrentEpisode']['art']['tvshow.fanart'] = obj['Artwork']['Backdrop'][0] + listitem.setContentLookup(False) def listitem_video(self, obj, listitem, item, seektime=None): diff --git a/resources/lib/objects/obj.py b/resources/lib/objects/obj.py index 13b2efaf..6ff845ac 100644 --- a/resources/lib/objects/obj.py +++ b/resources/lib/objects/obj.py @@ -109,9 +109,9 @@ class Objects(object): self.mapped_item[key] = obj break - self.mapped_item['ProviderName'] = self.objects.get('%sProviderName' % mapping_name) + if not mapping_name.startswith('Browse') and not mapping_name.startswith('Artwork') and not mapping_name.startswith('UpNext'): - if not mapping_name.startswith('Browse') and not mapping_name.startswith('Artwork'): + self.mapped_item['ProviderName'] = self.objects.get('%sProviderName' % mapping_name) self.mapped_item['Checksum'] = json.dumps(item['UserData']) return self.mapped_item diff --git a/resources/lib/objects/obj_map.json b/resources/lib/objects/obj_map.json index d98dc20c..d9d63e87 100644 --- a/resources/lib/objects/obj_map.json +++ b/resources/lib/objects/obj_map.json @@ -343,5 +343,17 @@ "PlayCount": "CurrentProgram/UserData/PlayCount", "Runtime": "CurrentProgram/RunTimeTicks", "MediaType": "MediaType" + }, + "UpNext": { + "episodeid": "Id", + "tvshowid": "SeriesId", + "plot": "Overview", + "showtitle": "SeriesName", + "title": "Name", + "playcount": "UserData/PlayCount", + "season": "ParentIndexNumber", + "episode": "IndexNumber", + "rating": "CommunityRating", + "firstaired": "ProductionYear" } } \ No newline at end of file