Skip to content

Commit

Permalink
[plugin.video.svtplay] 5.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
linqcan committed Nov 21, 2020
1 parent e45e0be commit ea6bd1e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugin.video.svtplay/addon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<addon id="plugin.video.svtplay" name="SVT Play" provider-name="nilzen" version="5.1.10">
<addon id="plugin.video.svtplay" name="SVT Play" provider-name="nilzen" version="5.1.11">
<requires>
<import addon="script.module.requests" version="2.22.0" />
<import addon="xbmc.python" version="2.25.0" />
Expand All @@ -19,7 +19,7 @@
<source>https://github.com/nilzen/xbmc-svtplay</source>
<forum>https://forum.kodi.tv/showthread.php?tid=67110</forum>
<news>
- Fix for broken watched status
- Season information is now shown in the title of a video, if available
</news>
<assets>
<icon>icon.png</icon>
Expand Down
5 changes: 4 additions & 1 deletion plugin.video.svtplay/resources/lib/api/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion plugin.video.svtplay/resources/lib/listing/listitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 4 additions & 1 deletion plugin.video.svtplay/resources/lib/svtplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit ea6bd1e

Please sign in to comment.