Merge pull request #792 from candry7731/Fix-Search

Fix Episode titles when search
This commit is contained in:
1hitsong 2022-10-11 20:10:26 -04:00 committed by GitHub
commit 8908f11bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 45 deletions

View File

@ -64,7 +64,8 @@ sub itemContentChanged() as void
else if itemData.json.lookup("Type") = "MusicAlbum"
m.title.font = "font:SmallestSystemFont"
m.staticTitle.font = "font:SmallestSystemFont"
else
m.series.visible = false
end if
m.staticTitle.text = m.title.text

View File

@ -8,60 +8,65 @@ end sub
'
' Push a new group onto the stack, replacing the existing group on the screen
sub pushScene(newGroup)
currentGroup = m.groups.peek()
if newGroup <> invalid
if currentGroup <> invalid
'Search through group and store off last focused item
if currentGroup.focusedChild <> invalid
focused = currentGroup.focusedChild
while focused.hasFocus() = false
focused = focused.focusedChild
end while
if currentGroup <> invalid
'Search through group and store off last focused item
if currentGroup.focusedChild <> invalid
focused = currentGroup.focusedChild
while focused.hasFocus() = false
focused = focused.focusedChild
end while
currentGroup.lastFocus = focused
currentGroup.setFocus(false)
else
currentGroup.setFocus(false)
end if
currentGroup.lastFocus = focused
currentGroup.setFocus(false)
if currentGroup.isSubType("JFGroup")
unregisterOverhangData(currentGroup)
end if
currentGroup.visible = false
if currentGroup.isSubType("JFScreen")
currentGroup.callFunc("OnScreenHidden")
end if
end if
m.groups.push(newGroup)
if currentGroup <> invalid
m.content.replaceChild(newGroup, 0)
else
currentGroup.setFocus(false)
m.content.appendChild(newGroup)
end if
if currentGroup.isSubType("JFGroup")
unregisterOverhangData(currentGroup)
if newGroup.isSubType("JFScreen")
newGroup.callFunc("OnScreenShown")
end if
currentGroup.visible = false
'observe info about new group, set overhang title, etc.
if newGroup.isSubType("JFGroup")
registerOverhangData(newGroup)
if currentGroup.isSubType("JFScreen")
currentGroup.callFunc("OnScreenHidden")
end if
end if
m.groups.push(newGroup)
if currentGroup <> invalid
m.content.replaceChild(newGroup, 0)
else
m.content.appendChild(newGroup)
end if
if newGroup.isSubType("JFScreen")
newGroup.callFunc("OnScreenShown")
end if
'observe info about new group, set overhang title, etc.
if newGroup.isSubType("JFGroup")
registerOverhangData(newGroup)
' Some groups set focus to a specific component within init(), so we don't want to
' change if that is the case.
if newGroup.isInFocusChain() = false
' Some groups set focus to a specific component within init(), so we don't want to
' change if that is the case.
if newGroup.isInFocusChain() = false
newGroup.setFocus(true)
end if
else if newGroup.isSubType("JFVideo")
newGroup.setFocus(true)
newGroup.control = "play"
m.overhang.visible = false
end if
else if newGroup.isSubType("JFVideo")
newGroup.setFocus(true)
newGroup.control = "play"
m.overhang.visible = false
else
currentGroup.focusedChild.setFocus(true)
end if
end sub
'
@ -141,7 +146,7 @@ end sub
'
' Clear previous scene from group stack
sub clearPreviousScene()
m.groups.pop()
m.groups.Delete(2)
end sub
'

View File

@ -110,6 +110,7 @@ sub Main (args as dynamic) as void
else if isNodeEvent(msg, "selectedItem")
' If you select a library from ANYWHERE, follow this flow
selectedItem = msg.getData()
m.selectedItemType = selectedItem.type
if selectedItem.type = "CollectionFolder" or selectedItem.type = "UserView" or selectedItem.type = "Folder" or selectedItem.type = "Channel" or selectedItem.type = "Boxset"
group = CreateItemGrid(selectedItem)
sceneManager.callFunc("pushScene", group)
@ -239,6 +240,7 @@ sub Main (args as dynamic) as void
else if isNodeEvent(msg, "episodeSelected")
' If you select a TV Episode from ANYWHERE, follow this flow
m.selectedItemType = "Episode"
node = getMsgPicker(msg, "picker")
video_id = node.id
if node.selectedAudioStreamIndex <> invalid and node.selectedAudioStreamIndex > 1
@ -268,6 +270,7 @@ sub Main (args as dynamic) as void
node = getMsgPicker(msg)
' TODO - swap this based on target.mediatype
' types: [ Series (Show), Episode, Movie, Audio, Person, Studio, MusicArtist ]
m.selectedItemType = node.type
if node.type = "Series"
group = CreateSeriesDetailsGroup(node)
else if node.type = "Movie"
@ -414,7 +417,7 @@ sub Main (args as dynamic) as void
end if
else if isNodeEvent(msg, "state")
node = msg.getRoSGNode()
if selectedItem.Type = "TvChannel" and node.state = "finished"
if m.selectedItemType = "TvChannel" and node.state = "finished"
video = CreateVideoPlayerGroup(node.id)
m.global.sceneManager.callFunc("pushScene", video)
m.global.sceneManager.callFunc("clearPreviousScene")