Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugin.video.svtplay@krypton] 5.1.21 #4387

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.20">
<addon id="plugin.video.svtplay" name="SVT Play" provider-name="nilzen" version="5.1.21">
<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>
- Updates to program listings
- Update genre listings
</news>
<assets>
<icon>icon.png</icon>
Expand Down
23 changes: 12 additions & 11 deletions plugin.video.svtplay/resources/lib/api/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ def __init__(self):
pass

def getPopular(self):
return self.getGridPageContents("popular_start")
return self.getFionaPageContainer("popular_start")

def getLatest(self):
return self.getGridPageContents("latest_start")
return self.getFionaPageContainer("latest_start")

def getLastChance(self):
return self.getGridPageContents("lastchance_start")
return self.getFionaPageContainer("lastchance_start")

def getLive(self):
return self.getGridPageContents("live_start")
return self.getFionaPageContainer("live_start")

def getAtoO(self):
return self.__get_all_programs()
Expand Down Expand Up @@ -86,19 +86,20 @@ def getProgramsForGenre(self, genre):
item = teaser["item"]
title = item["name"]
item_id = item["urls"]["svtplay"]
thumbnail = self.get_thumbnail_url(item["image"]["id"], item["image"]["changed"]) if "image" in item else ""
thumbnail = self.get_thumbnail_url(teaser["images"]["wide"]["id"], teaser["images"]["wide"]["changed"]) if "images" in teaser else ""
fanart = self.get_fanart_url(item["images"]["cleanWide"]["id"], item["images"]["cleanWide"]["changed"]) if "images" in item else ""
geo_restricted = item["restrictions"]["onlyAvailableInSweden"]
info = {
"plot" : teaser["subHeading"]
"plot" : teaser.get("description", "")
}
type_name = item["__typename"]
play_item = self.__create_item(title, type_name, item_id, geo_restricted, thumbnail, info)
play_item = self.__create_item(title, type_name, item_id, geo_restricted, thumbnail, info, fanart)
programs.append(play_item)
return programs
def getGridPageContents(self, selectionId):

def getFionaPageContainer(self, selectionId):
operation_name = "GridPage"
query_hash = "a8248fc130da34208aba94c4d5cc7bd44187b5f36476d8d05e03724321aafb40"
query_hash = "1e2d15ff7ffa578d33ebf1287d3f7af7fd47125552b564e96fd277a744345a69"
variables = {"selectionId" : selectionId}
json_data = self.__get(operation_name, query_hash, variables=variables)
if not json_data:
Expand All @@ -123,7 +124,7 @@ def getGridPageContents(self, selectionId):
list_items.append(self.__create_item(title, item["__typename"], item_id, geo_restricted, thumbnail, info, fanart))
return list_items

def getVideoContent(self, slug):
def getEpisodesForPath(self, slug):
operation_name = "DetailsPageQuery"
query_hash = "e240d515657bbb54f33cf158cea581f6303b8f01f3022ea3f9419fbe3a5614b0"
variables = {"path":"/{}".format(slug)}
Expand Down
6 changes: 3 additions & 3 deletions plugin.video.svtplay/resources/lib/svtplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def view_category(self, genre):

def view_episodes(self, slug):
logging.log("View episodes for {}".format(slug))
episodes = self.graphql.getVideoContent(slug)
episodes = self.graphql.getEpisodesForPath(slug)
if episodes is None:
logging.log("No episodes found")
logging.log("No episodes found for {}".format(slug))
return
self.__create_dir_items(episodes)

Expand Down Expand Up @@ -256,7 +256,7 @@ def __create_dir_item(self, play_item):
logging.log("Hiding geo restricted item {} as setting is on".format(play_item.title))
return
info = play_item.info
fanart = play_item.fanart if play_item.item_type == PlayItem.VIDEO_ITEM else ""
fanart = play_item.fanart
title = play_item.title
if play_item.item_type == PlayItem.VIDEO_ITEM and play_item.season_title:
title = "{episode} ({season})".format(season=play_item.season_title, episode=play_item.title)
Expand Down
Loading