add user setting: go to straight episode listing

This commit is contained in:
Alex Wardle 2022-12-22 16:02:13 -07:00
parent 75eee67913
commit efe4530917
3 changed files with 25 additions and 1 deletions

View File

@ -657,6 +657,16 @@
<translation>Blur Unwatched Episodes</translation>
<extracomment>Option Title in user setting screen</extracomment>
</message>
<message>
<source>Go straight to episode listing (if series has only one season)</source>
<translation>Go straight to episode listing (if series has only one season)</translation>
<extracomment>Settings Menu - Title for option</extracomment>
</message>
<message>
<source>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.</source>
<translation>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.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>If enabled, images of unwatched episodes will be blurred.</source>
<translation>If enabled, images of unwatched episodes will be blurred.</translation>

View File

@ -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"
}
]
},

View File

@ -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)