diff --git a/components/tvshows/TVEpisodes.brs b/components/tvshows/TVEpisodes.brs index 915aeb97..d063b9ef 100644 --- a/components/tvshows/TVEpisodes.brs +++ b/components/tvshows/TVEpisodes.brs @@ -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 diff --git a/source/Main.brs b/source/Main.brs index 839139b4..b195baee 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -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 diff --git a/source/utils/misc.brs b/source/utils/misc.brs index 31b80f36..04d5c568 100644 --- a/source/utils/misc.brs +++ b/source/utils/misc.brs @@ -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