2020-02-23 04:47:00 +00:00
|
|
|
sub init()
|
2021-07-09 20:08:32 +00:00
|
|
|
m.top.optionsAvailable = false
|
2022-04-24 03:49:42 +00:00
|
|
|
|
|
|
|
m.rows = m.top.findNode("picker")
|
2022-06-09 20:51:04 +00:00
|
|
|
m.poster = m.top.findNode("seasonPoster")
|
|
|
|
m.Random = m.top.findNode("Random")
|
|
|
|
m.tvEpisodeRow = m.top.findNode("tvEpisodeRow")
|
|
|
|
|
|
|
|
|
2022-04-24 03:49:42 +00:00
|
|
|
m.rows.observeField("doneLoading", "updateSeason")
|
|
|
|
end sub
|
|
|
|
|
|
|
|
sub setSeasonLoading()
|
|
|
|
m.top.overhangTitle = tr("Loading...")
|
2020-02-23 04:47:00 +00:00
|
|
|
end sub
|
|
|
|
|
2022-04-24 03:49:42 +00:00
|
|
|
sub updateSeason()
|
2022-06-09 20:51:04 +00:00
|
|
|
imgParams = { "maxHeight": 450, "maxWidth": 300 }
|
|
|
|
m.poster.uri = ImageURL(m.top.seasonData.Id, "Primary", imgParams)
|
2022-06-11 22:55:36 +00:00
|
|
|
m.Random.visible = true
|
2021-07-09 20:08:32 +00:00
|
|
|
m.top.overhangTitle = m.top.seasonData.SeriesName + " - " + m.top.seasonData.name
|
2020-02-23 04:47:00 +00:00
|
|
|
end sub
|
2020-12-08 20:05:22 +00:00
|
|
|
|
|
|
|
function onKeyEvent(key as string, press as boolean) as boolean
|
2021-07-09 20:08:32 +00:00
|
|
|
handled = false
|
2022-04-24 03:49:42 +00:00
|
|
|
|
2022-06-09 20:51:04 +00:00
|
|
|
if key = "left" and not m.Random.hasFocus()
|
|
|
|
m.Random.setFocus(true)
|
|
|
|
return true
|
|
|
|
end if
|
|
|
|
|
|
|
|
if key = "right" and not m.tvEpisodeRow.hasFocus()
|
|
|
|
m.tvEpisodeRow.setFocus(true)
|
|
|
|
return true
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if key = "OK" or key = "play"
|
|
|
|
if m.Random.hasFocus()
|
|
|
|
randomEpisode = Rnd(m.rows.getChild(0).objects.items.count()) - 1
|
|
|
|
m.top.quickPlayNode = m.rows.getChild(0).objects.items[randomEpisode]
|
|
|
|
return true
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
2022-04-24 03:49:42 +00:00
|
|
|
focusedChild = m.top.focusedChild.focusedChild
|
|
|
|
if focusedChild.content = invalid then return handled
|
|
|
|
|
|
|
|
' OK needs to be handled on release...
|
|
|
|
proceed = false
|
|
|
|
if key = "OK"
|
|
|
|
proceed = true
|
|
|
|
end if
|
|
|
|
|
|
|
|
if press and key = "play" or proceed = true
|
|
|
|
itemToPlay = focusedChild.content.getChild(focusedChild.rowItemFocused[0]).getChild(0)
|
|
|
|
if itemToPlay <> invalid and itemToPlay.id <> ""
|
|
|
|
m.top.quickPlayNode = itemToPlay
|
2021-07-09 20:08:32 +00:00
|
|
|
end if
|
2022-04-24 03:49:42 +00:00
|
|
|
handled = true
|
2020-12-08 20:05:22 +00:00
|
|
|
end if
|
2021-07-09 20:08:32 +00:00
|
|
|
return handled
|
2020-12-08 20:05:22 +00:00
|
|
|
end function
|