Merge pull request #1013 from candry7731/NextUpButtonDuration

Create Setting for Next Episode Button Time
This commit is contained in:
1hitsong 2023-02-05 07:06:57 -05:00 committed by GitHub
commit c0aa736b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 9 deletions

View File

@ -19,6 +19,7 @@ sub init()
m.nextEpisodeButton = m.top.findNode("nextEpisode")
m.nextEpisodeButton.text = tr("Next Episode")
m.nextEpisodeButton.setFocus(false)
m.nextupbuttonseconds = get_user_setting("playback.nextupbuttonseconds", "30")
m.showNextEpisodeButtonAnimation = m.top.findNode("showNextEpisodeButton")
m.hideNextEpisodeButtonAnimation = m.top.findNode("hideNextEpisodeButton")
@ -64,7 +65,11 @@ end sub
'
'Update count down text
sub updateCount()
m.nextEpisodeButton.text = tr("Next Episode") + " " + Int(m.top.runTime - m.top.position).toStr()
nextEpisodeCountdown = Int(m.top.runTime - m.top.position)
if nextEpisodeCountdown < 0
nextEpisodeCountdown = 0
end if
m.nextEpisodeButton.text = tr("Next Episode") + " " + nextEpisodeCountdown.toStr()
end sub
'
@ -77,7 +82,13 @@ end sub
' Checks if we need to display the Next Episode button
sub checkTimeToDisplayNextEpisode()
if int(m.top.position) >= (m.top.runTime - 30)
nextEpisodeCountdown = Int(m.top.runTime - m.top.position)
if nextEpisodeCountdown < 0
hideNextEpisodeButton()
return
end if
if int(m.top.position) >= (m.top.runTime - Val(m.nextupbuttonseconds))
showNextEpisodeButton()
updateCount()
return

View File

@ -1098,5 +1098,15 @@
<translation>If enabled, the number of unwatched episodes in a series/season will be removed.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>Next Episode Button Time</source>
<translation>Next Episode Button Time</translation>
<extracomment>Settings Menu - Title for option</extracomment>
</message>
<message>
<source>Set how many seconds before the end of an episode the Next Episode button should appear. Set to 0 to disable.</source>
<translation>Set how many seconds before the end of an episode the Next Episode button should appear. Set to 0 to disable.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
</context>
</TS>

View File

@ -3,13 +3,6 @@
"title": "Playback",
"description": "Settings relating to playback and supported codec and media types.",
"children": [
{
"title": "Cinema Mode",
"description": "Cinema Mode brings the theater experience straight to your living room with the ability to play custom intros before the main feature.",
"settingName": "playback.cinemamode",
"type": "bool",
"default": "false"
},
{
"title": "Codec Support",
"description": "Enable or disable Direct Play support for certain codecs",
@ -77,6 +70,20 @@
}
]
},
{
"title": "Cinema Mode",
"description": "Cinema Mode brings the theater experience straight to your living room with the ability to play custom intros before the main feature.",
"settingName": "playback.cinemamode",
"type": "bool",
"default": "false"
},
{
"title": "Next Episode Button Time",
"description": "Set how many seconds before the end of an episode the Next Episode button should appear. Set to 0 to disable.",
"settingName": "playback.nextupbuttonseconds",
"type": "integer",
"default": "30"
},
{
"title": "Text Subtitles Only",
"description": "Only display text subtitles to minimize transcoding.",