save userConfig to global var + check userConfig before showing "next episode" popup

This commit is contained in:
Charles Ewert 2023-03-22 14:10:07 -04:00
parent ef2b1293ec
commit d34002cc3d
9 changed files with 9 additions and 12 deletions

View File

@ -86,7 +86,7 @@ end sub
' Runs Next Episode button animation and sets focus to button
sub showNextEpisodeButton()
if m.top.content.contenttype <> 4 then return
if m.top.userConfig.EnableNextEpisodeAutoPlay and not m.nextEpisodeButton.visible
if m.global.userConfig.EnableNextEpisodeAutoPlay and not m.nextEpisodeButton.visible
m.showNextEpisodeButtonAnimation.control = "start"
m.nextEpisodeButton.setFocus(true)
m.nextEpisodeButton.visible = true

View File

@ -11,7 +11,6 @@
<field id="directPlaySupported" type="boolean" />
<field id="systemOverlay" type="boolean" value="false" />
<field id="showID" type="string" />
<field id="userConfig" type="assocarray" />
<field id="transcodeParams" type="assocarray" />
<field id="transcodeAvailable" type="boolean" value="false" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<component name="Home" extends="JFGroup">
<children>
<Poster id="backdrop" loadDisplayMode="scaleToZoom" width="1920" height="1200" />
@ -7,7 +7,6 @@
</children>
<interface>
<field id="selectedItem" alias="homeRows.selectedItem" />
<field id="userConfig" alias="homeRows.userConfig" />
<field id="quickPlayNode" alias="homeRows.quickPlayNode" />
<field id="timeLastRefresh" type="integer" />
<function name="refresh" />

View File

@ -97,7 +97,7 @@ sub onLibrariesLoaded()
' validate library data
if isValid(m.libraryData) and m.libraryData.count() > 0
userConfig = m.top.userConfig
userConfig = m.global.userConfig
' populate My Media row
filteredMedia = filterNodeArray(m.libraryData, "id", userConfig.MyMediaExcludes)

View File

@ -2,7 +2,6 @@
<component name="HomeRows" extends="RowList">
<interface>
<field id="selectedItem" type="node" alwaysNotify="true" />
<field id="userConfig" type="assocarray" />
<field id="quickPlayNode" type="node" alwaysNotify="true" />
<function name="updateHomeRows" />
<function name="loadLibraries" />

View File

@ -98,7 +98,7 @@ end sub
'
' Runs Next Episode button animation and sets focus to button
sub showNextEpisodeButton()
if not m.nextEpisodeButton.visible
if m.global.userConfig.EnableNextEpisodeAutoPlay and not m.nextEpisodeButton.visible
m.showNextEpisodeButtonAnimation.control = "start"
m.nextEpisodeButton.setFocus(true)
m.nextEpisodeButton.visible = true

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<component name="VideoPlayerView" extends="Video">
<interface>
<field id="backPressed" type="boolean" alwaysNotify="true" />

View File

@ -47,12 +47,13 @@ sub Main (args as dynamic) as void
app_start:
' First thing to do is validate the ability to use the API
if not LoginFlow() then return
' remove previous scenes from the stack
sceneManager.callFunc("clearScenes")
' save user config
m.global.addFields({ userConfig: m.user.configuration })
' load home page
sceneManager.currentUser = m.user.Name
group = CreateHomeGroup()
group.userConfig = m.user.configuration
group.callFunc("loadLibraries")
sceneManager.callFunc("pushScene", group)

View File

@ -2,7 +2,6 @@ function VideoPlayer(id, mediaSourceId = invalid, audio_stream_idx = 1, subtitle
' Get video controls and UI
video = CreateObject("roSGNode", "JFVideo")
video.id = id
video.userConfig = m.user.configuration
AddVideoContent(video, mediaSourceId, audio_stream_idx, subtitle_idx, -1, forceTranscoding, showIntro, allowResumeDialog)
if video.errorMsg = "introaborted"