From ea6bd1e5e4c4c08fd45e4839afea6c828eb4fd02 Mon Sep 17 00:00:00 2001 From: Erik Lindqvist Date: Sat, 21 Nov 2020 19:49:50 +0100 Subject: [PATCH] [plugin.video.svtplay] 5.1.11 --- plugin.video.svtplay/addon.xml | 4 ++-- plugin.video.svtplay/resources/lib/api/graphql.py | 5 ++++- plugin.video.svtplay/resources/lib/listing/listitem.py | 3 ++- plugin.video.svtplay/resources/lib/svtplay.py | 5 ++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/plugin.video.svtplay/addon.xml b/plugin.video.svtplay/addon.xml index 445e89c156..876e0e80a7 100644 --- a/plugin.video.svtplay/addon.xml +++ b/plugin.video.svtplay/addon.xml @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ https://github.com/nilzen/xbmc-svtplay https://forum.kodi.tv/showthread.php?tid=67110 -- Fix for broken watched status +- Season information is now shown in the title of a video, if available icon.png diff --git a/plugin.video.svtplay/resources/lib/api/graphql.py b/plugin.video.svtplay/resources/lib/api/graphql.py index 0b780ec74e..d871ef90f8 100644 --- a/plugin.video.svtplay/resources/lib/api/graphql.py +++ b/plugin.video.svtplay/resources/lib/api/graphql.py @@ -113,6 +113,9 @@ def getVideoContent(self, slug): continue for item in content["items"]: item = item["item"] + season_title = "" + if content["type"] == "Season" and content["name"] and item["positionInSeason"]: + season_title = content["name"] title = item["name"] video_id = item["urls"]["svtplay"] geo_restricted = item["restrictions"]["onlyAvailableInSweden"] @@ -122,7 +125,7 @@ def getVideoContent(self, slug): "plot" : item["longDescription"], "duration" : item.get("duration", 0) } - video_item = VideoItem(title, video_id, thumbnail, geo_restricted, info, fanart) + video_item = VideoItem(title, video_id, thumbnail, geo_restricted, info, fanart, season_title) video_items.append(video_item) return video_items diff --git a/plugin.video.svtplay/resources/lib/listing/listitem.py b/plugin.video.svtplay/resources/lib/listing/listitem.py index 7c26f41e85..1cefac9f2b 100644 --- a/plugin.video.svtplay/resources/lib/listing/listitem.py +++ b/plugin.video.svtplay/resources/lib/listing/listitem.py @@ -34,7 +34,8 @@ class VideoItem(PlayItem): """ A video list item. """ - def __init__(self, title, video_id, thumbnail, geo_restricted, info={}, fanart=""): + def __init__(self, title, video_id, thumbnail, geo_restricted, info={}, fanart="", season_title=""): + self.season_title = season_title super(VideoItem, self).__init__(title, video_id, PlayItem.VIDEO_ITEM, thumbnail, geo_restricted, info, fanart) class ShowItem(PlayItem): diff --git a/plugin.video.svtplay/resources/lib/svtplay.py b/plugin.video.svtplay/resources/lib/svtplay.py index d181095522..95fc82525d 100644 --- a/plugin.video.svtplay/resources/lib/svtplay.py +++ b/plugin.video.svtplay/resources/lib/svtplay.py @@ -268,7 +268,10 @@ def __create_dir_item(self, play_item): return info = play_item.info fanart = play_item.fanart if play_item.item_type == PlayItem.VIDEO_ITEM else "" - self.__add_directory_item(play_item.title, params, play_item.thumbnail, folder, False, info, fanart) + title = play_item.title + if play_item.item_type == PlayItem.VIDEO_ITEM and play_item.season_title: + title = "{season} - {episode}".format(season=play_item.season_title, episode=play_item.title) + self.__add_directory_item(title, params, play_item.thumbnail, folder, False, info, fanart) def __is_geo_restricted(self, play_item): return play_item.geo_restricted and \