Skip to content

Commit

Permalink
[plugin.video.retrospect] v5.7.16
Browse files Browse the repository at this point in the history
  • Loading branch information
basrieter committed Aug 8, 2024
1 parent 5feecaa commit dc3497f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
10 changes: 5 additions & 5 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.7.15"
version="5.7.16"
name="Retrospect"
provider-name="Bas Rieter">

Expand Down Expand Up @@ -123,9 +123,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.7.15 - Changelog - 2024-08-07[/B]
<news>[B]Retrospect v5.7.16 - Changelog - 2024-08-08[/B]

This version includes some minor fixes in the &quot;search&quot; feature and fixes the GoPlay and Videoland channels.
Fixed: Videoland Single detection (Fixed #1824).

[B]Framework related[/B]
* Fixed: Highlighter of searchresults were shown in the favourites (Fixes #1818).
Expand All @@ -136,8 +136,8 @@ _None_

[B]Channel related[/B]
* Fixed: Vier.be season and video parsing (See #1820).
* Fixed: Videoland streams and live TV (Fixes #1813 and Fixes #1804)

* Fixed: Videoland streams and live TV (Fixes #1813 and Fixes #1804).
* Fixed: Videoland Single detection (Fixed #1824).
</news>
<assets>
<icon>resources/media/icon.png</icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,26 +282,31 @@ def postprocess_episodes(self, data, items: List[MediaItem]) -> List[MediaItem]:
# This postprocessing function fixes date ordering by setting the date of an episode, if it has no date, to the date of the previous episode.
# This is probably not the real broadcast date, but it at least fixes the order.
if (len(items) > 1
and data.json.get("featureId") == "videos_by_season_by_program"
and all(item.media_type == mediatype.EPISODE and not re.match(r"[Aa]flevering \d+", item.name) for item in items)):
and data.json.get("featureId") == "videos_by_season_by_program"
and all(item.media_type == mediatype.EPISODE
and not re.match(r"[Aa]flevering \d+", item.name) for item in
items)):
date = ""
for index, item in enumerate(items, start=1):
item.name = f"{index:02} {item.name}"
if not item.has_date() and date:
previous_episode_date = DateHelper.get_datetime_from_string(date, "%Y-%m-%d")
item.set_date(previous_episode_date.year, previous_episode_date.month, previous_episode_date.day)
item.set_date(previous_episode_date.year, previous_episode_date.month,
previous_episode_date.day)
item.name = f"{item.name} [date unknown]"
else:
date = item.get_date()

return items

def create_program_item(self, result_set: dict) -> Union[MediaItem, List[MediaItem], None]:
if not result_set["title"] and result_set.get("blockTemplateId") == "Solo":
# Most likely a single video or movie
if result_set.get("content", {}).get("items"):
result_set["content"]["items"][0]["itemContent"]["title"] = self.parentItem.name
return self.create_content_item(result_set["content"]["items"][0])
if not result_set["title"]:
# Perhaps it is a single video?
if result_set.get("blockTemplateId") == "Solo":
# Most likely a single video or movie
if result_set.get("content", {}).get("items"):
result_set["content"]["items"][0]["itemContent"]["title"] = self.parentItem.name
return self.create_content_item(result_set["content"]["items"][0])

return None

Expand Down Expand Up @@ -422,7 +427,7 @@ def update_video_item(self, item: MediaItem) -> MediaItem:
# M3u8.set_input_stream_addon_input(stream)
return item

def log_on(self):
def log_on(self, username=None, password=None) -> bool:
""" Logs on to a website, using an url.
First checks if the channel requires log on. If so and it's not already
Expand All @@ -434,19 +439,27 @@ def log_on(self):
After a successful log on the self.loggedOn property is set to True and
True is returned.
:param username: Making it testable.
:param password: Making it testable.
:return: indication if the login was successful.
:rtype: bool
"""

if self.loggedOn:
return self.loggedOn

# Always try to log on. If the username was changed to empty, we should clear the current
# log in.
username: Optional[str] = self._get_setting("videolandnl_username", value_for_none=None)
username: Optional[str] = username or self._get_setting(
"videolandnl_username", value_for_none=None)
if not username:
XbmcWrapper.show_dialog(None, LanguageHelper.MissingCredentials)

result = self.__authenticator.log_on(username=username, channel_guid=self.guid,
setting_id="videolandnl_password")
result = self.__authenticator.log_on(
username=username, password=password,
channel_guid=self.guid, setting_id="videolandnl_password")

# Set some defaults
self.__uid = result.uid
Expand Down

0 comments on commit dc3497f

Please sign in to comment.