Skip to content

Commit

Permalink
Added: Titles for profile folders (See #1828).
Browse files Browse the repository at this point in the history
  • Loading branch information
basrieter committed Aug 25, 2024
1 parent 5b4d487 commit 46b22e1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 29 deletions.
52 changes: 24 additions & 28 deletions channels/channel.nos/nos2010/chn_nos2010.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,6 @@ def __init__(self, channel_info: ChannelInfo):
parser=["collections"], creator=self.create_profile_content_item,
requires_logon=True)

# self._add_data_parser("https://www.npostart.nl/ums/accounts/@me/favourites?",
# preprocessor=self.extract_tiles,
# parser=episode_parser,
# creator=self.create_episode_item,
# requires_logon=True)
# self._add_data_parser("https://www.npostart.nl/ums/accounts/@me/favourites/episodes?",
# preprocessor=self.extract_tiles,
# parser=video_parser,
# creator=self.create_npo_item,
# requires_logon=True)

# OLD but still working?
# live radio, the folders and items
self._add_data_parser(
Expand Down Expand Up @@ -198,6 +187,23 @@ def __init__(self, channel_info: ChannelInfo):
"NED3": "NPO 3",
}

self.__collection_names = {
"follows": LanguageHelper.Following,
"trending": LanguageHelper.Trending,
"because-you-watched": LanguageHelper.RecommendedTvShows,
"recent": LanguageHelper.Recent,
"public-value": None,
"series": LanguageHelper.TvShows,
"crime": None,
"documentaries": None,
"continue": LanguageHelper.ContinueWatching,
"news": LanguageHelper.LatestNews,
"popular": LanguageHelper.Popular,
"recommended-for-you": LanguageHelper.RecommendedVideos,
"films": LanguageHelper.Movies,
"youth": None,
}

# ====================================== Actual channel setup STOPS here =======================================
return

Expand Down Expand Up @@ -478,28 +484,18 @@ def create_profile_content_item(self, result_set: Dict[str, str]) -> Union[Media
f"profileGuid={profile_id}&"
# f"subscriptionType=free"
)

# because-you-watched-free-v0
# continue-watching-v1
# crime-anonymous-v0
# documentaries-anonymous-v0
# films-anonymous-v0
# follows-v0
# news-anonymous-v0
# popular-anonymous-v0
# public-value-free-v0
# recent-free-v0
# recommended-for-you-free-v0
# series-anonymous-v0
# trending-anonymous-v0
# youth-anonymous-v0
title_key = folder_key.rsplit("-", 2)[0]
title_id = self.__collection_names.get(title_key, None)
if not title_id:
return None
title = LanguageHelper.get_localized_string(title_id)

list_type = result_set["type"].lower()
if list_type == "program":
result = FolderItem(folder_key, url, content_type=contenttype.EPISODES, media_type=mediatype.TVSHOW)
result = FolderItem(title, url, content_type=contenttype.EPISODES, media_type=mediatype.TVSHOW)
result.metaData["retrospect:parser"] = "collection-with-videos"
elif list_type == "series":
result = FolderItem(folder_key, url, content_type=contenttype.TVSHOWS)
result = FolderItem(title, url, content_type=contenttype.TVSHOWS)
result.metaData["retrospect:parser"] = "collection-with-series"
else:
Logger.warning(f"Missing list type: {list_type}")
Expand Down
18 changes: 17 additions & 1 deletion resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,23 @@ msgctxt "#30372"
msgid "New Search"
msgstr ""

# empty strings from id 30373 to 30400
msgctxt "#30373"
msgid "Following"
msgstr ""

msgctxt "#30374"
msgid "Recommended TV Shows"
msgstr ""

msgctxt "#30375"
msgid "Recommended Videos"
msgstr ""

msgctxt "#30376"
msgid "Continue Watching"
msgstr ""

# empty strings from id 30377 to 30400

msgctxt "#30401"
msgid "Dutch"
Expand Down
4 changes: 4 additions & 0 deletions resources/lib/helpers/languagehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ class LanguageHelper(object):
AllEpisodes = 30370
Trending = 30371
NewSearch = 30372
Following = 30373
RecommendedTvShows = 30374
RecommendedVideos = 30375
ContinueWatching = 30376

ChannelSelection = 30507
ShortCutName = 30512
Expand Down

0 comments on commit 46b22e1

Please sign in to comment.