Fix TV Episode focus issues

1. Pressing back on resume dialog on episode list
2. Choosing resume and pressing back from video playback
This commit is contained in:
1hitsong 2022-12-09 20:26:32 -05:00
parent 264c9cf4e3
commit 4f4b1d5748
3 changed files with 14 additions and 0 deletions

View File

@ -54,6 +54,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
if press and key = "play" or proceed = true
m.top.lastFocus = focusedChild
itemToPlay = focusedChild.content.getChild(focusedChild.rowItemFocused[0]).getChild(0)
if itemToPlay <> invalid and itemToPlay.id <> ""
m.top.quickPlayNode = itemToPlay

View File

@ -95,6 +95,13 @@ sub Main (args as dynamic) as void
if video <> invalid and video.errorMsg <> "introaborted"
sceneManager.callFunc("pushScene", video)
end if
group = sceneManager.callFunc("getActiveScene")
if LCase(group.subtype()) = "tvepisodes"
if isValid(group.lastFocus)
group.lastFocus.setFocus(true)
end if
end if
end if
else if isNodeEvent(msg, "selectedItem")
' If you select a library from ANYWHERE, follow this flow

View File

@ -91,6 +91,12 @@ function get_dialog_result(dialog, port)
end function
function lastFocusedChild(obj as object) as object
if LCase(obj.focusedChild.focusedChild.subType()) = "tvepisodes"
if isValid(obj?.focusedChild?.focusedChild?.lastFocus)
return obj.focusedChild.focusedChild.lastFocus
end if
end if
child = obj
for i = 0 to obj.getChildCount()
if obj.focusedChild <> invalid