Skip to content

Commit

Permalink
Merge pull request #4389 from basrieter/retrospect-matrix
Browse files Browse the repository at this point in the history
[plugin.video.retrospect] v5.6.6
  • Loading branch information
basrieter authored Sep 21, 2023
2 parents 80387fd + 2c07a4a commit 1eccdb0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
11 changes: 4 additions & 7 deletions plugin.video.retrospect/addon.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.retrospect"
version="5.6.5"
version="5.6.6"
name="Retrospect"
provider-name="Bas Rieter">

Expand Down Expand Up @@ -122,9 +122,9 @@
<platform>all</platform>
<license>GPL-3.0-or-later</license>
<language>en nl de sv no lt lv fi</language>
<news>[B]Retrospect v5.6.5 - Changelog - 2023-09-13[/B]
<news>[B]Retrospect v5.6.6 - Changelog - 2023-09-21[/B]

This update includes fixes for NPO, MTV and SVT channels.
Added some SVT improvements.

[B]Framework related[/B]
_None_
Expand All @@ -133,10 +133,7 @@ _None_
_None_

[B]Channel related[/B]
* Fixed: Better error messages on NPO Start error (See #1713).
* Fixed: MTV date parsing.
* Fixed: SVT Listing broke due to API changes (Fixes #1718).
* Fixed: Issue with missing genre info in EPG data (Fixes #1717).
* Fixed: SVT Descriptions for some items (Fixes #1719).

</news>
<assets>
Expand Down
28 changes: 22 additions & 6 deletions plugin.video.retrospect/channels/channel.se/svt/chn_svt.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,14 @@ def create_api_teaser_type(self, result_set):
# Transfer some items
new_result_set[self.__parent_images] = result_set.get(self.__parent_images)

if "longDescription" not in new_result_set:
new_result_set["longDescription"] = result_set.get("description")
badge = (result_set.get("badge") or {}).get("altText")
description = result_set.get("description")
if badge and description:
new_result_set["longDescription"] = f"[COLOR gold]{badge}[/COLOR]\n\n{description}"
elif badge:
new_result_set["longDescription"] = f"[COLOR gold]{badge}[/COLOR]"
elif description:
new_result_set["longDescription"] = description

if "images" in result_set:
new_result_set["images"] = result_set["images"]
Expand Down Expand Up @@ -679,6 +685,9 @@ def create_api_episode_type(self, result_set, add_parent_title=False):

item.name = "{:02}:{:02} - {}".format(hour, minute, item.name)

elif "live just nu" in item.description.lower():
item.name = "{} [COLOR gold](live)[/COLOR]".format(item.name)

item.media_type = mediatype.VIDEO
season_info = result_set.get("positionInSeason")
if bool(season_info):
Expand Down Expand Up @@ -934,7 +943,7 @@ def fetch_genre_api_data(self, data):
program_items = [genres["items"] for genres in possible_lists if
genres["selectionType"] == "all"]
json_data.json = {
"programs": [p["item"] for p in program_items[0]],
"programs": [p for p in program_items[0]],
}
return json_data, []

Expand Down Expand Up @@ -1018,9 +1027,8 @@ def create_channel_item(self, channel):
% (channel_title, title,
start_time.tm_hour, start_time.tm_min, end_time.tm_hour, end_time.tm_min)
else:
title = "%s: %s (%02d:%02d - %02d:%02d)" \
% (channel_title, title,
start_time.tm_hour, start_time.tm_min, end_time.tm_hour, end_time.tm_min)
title = "%s: %s (%02d:%02d)" \
% (channel_title, title, start_time.tm_hour, start_time.tm_min)

channel_item = MediaItem(
title,
Expand Down Expand Up @@ -1230,12 +1238,20 @@ def __extract_artwork(self, images: dict, item: MediaItem) -> None:
def create_url(image: dict, art: str, width: int) -> str:
return f"https://www.svtstatic.se/image/{art}/{width}/{image['id']}/{image['changed']}?quality=70"

description = None
if "wide" in images:
item.thumb = create_url(images["wide"], "wide", width=720)
item.fanart = create_url(images["wide"], "wide", width=1920)
description = images["wide"].get("description")
elif "cleanWide" in images:
item.thumb = create_url(images["cleanWide"], "wide", width=720)
item.fanart = create_url(images["cleanWide"], "wide", width=1920)
description = images["wide"].get("description")

if description and item.description:
item.description = f"{item.description}\n\n{description}"
elif description:
item.description = description

# if "portrait" in images:
# item.poster = create_url(images["portrait"], "portrait", width=512)
Expand Down

0 comments on commit 1eccdb0

Please sign in to comment.