From efe45309172a2765452b90b6b9827fe7ba8a1c6e Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Thu, 22 Dec 2022 16:02:13 -0700 Subject: [PATCH] add user setting: go to straight episode listing --- locale/en_US/translations.ts | 10 ++++++++++ settings/settings.json | 7 +++++++ source/ShowScenes.brs | 9 ++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/locale/en_US/translations.ts b/locale/en_US/translations.ts index 8d86143d..0b7e0ae1 100644 --- a/locale/en_US/translations.ts +++ b/locale/en_US/translations.ts @@ -657,6 +657,16 @@ Blur Unwatched Episodes Option Title in user setting screen + + Go straight to episode listing (if series has only one season) + Go straight to episode listing (if series has only one season) + Settings Menu - Title for option + + + If enabled, selecting a TV series with only one season will go directly to the episode listing for that episode, rather than the season listing. + If enabled, selecting a TV series with only one season will go directly to the episode listing for that episode, rather than the season listing. + Settings Menu - Description for option + If enabled, images of unwatched episodes will be blurred. If enabled, images of unwatched episodes will be blurred. diff --git a/settings/settings.json b/settings/settings.json index 1b70da60..a04f6a26 100644 --- a/settings/settings.json +++ b/settings/settings.json @@ -87,6 +87,13 @@ "settingName": "ui.tvshows.blurunwatched", "type": "bool", "default": "false" + }, + { + "title": "Go straight to episode listing (if series has only one season)", + "description": "If enabled, selecting a TV series with only one season will go directly to the episode listing for that episode, rather than the season listing.", + "settingName": "ui.tvshows.goStraightToEpisodeListing", + "type": "bool", + "default": "true" } ] }, diff --git a/source/ShowScenes.brs b/source/ShowScenes.brs index 90042322..97f423ff 100644 --- a/source/ShowScenes.brs +++ b/source/ShowScenes.brs @@ -358,12 +358,19 @@ function CreateMovieDetailsGroup(movie) end function function CreateSeriesDetailsGroup(series) + ' Get season data early in the function so we can check number of seasons. + seasonData = TVSeasons(series.id) + ' Divert to season details if user setting goStraightToEpisodeListing is enabled and only one season exists. + if get_user_setting("ui.tvshows.goStraightToEpisodeListing") = "true" and seasonData.Items.Count() = 1 + print "Returning single season" + return CreateSeasonDetailsGroupByID(series.id, seasonData.Items[0].id) + end if group = CreateObject("roSGNode", "TVShowDetails") group.optionsAvailable = false m.global.sceneManager.callFunc("pushScene", group) group.itemContent = ItemMetaData(series.id) - group.seasonData = TVSeasons(series.id) + group.seasonData = seasonData ' Re-use variable from beginning of function group.observeField("seasonSelected", m.port)