Refresh Roku channels when opening the guide

This commit is contained in:
Josh
2026-11-13 16:35:11 -05:00
parent 9c6f48186d
commit 160f74c294
3 changed files with 14 additions and 5 deletions

View File

@@ -86,11 +86,20 @@ sub onGuide(event as object)
return
end if
syncClock(data.serverTime)
activeId = invalid
previousId = invalid
if m.channelIndex >= 0 then activeId = m.channels[m.channelIndex].id
if m.previousIndex >= 0 then previousId = m.channels[m.previousIndex].id
m.guideChannels = data.channels
selected = 0
for i = 0 to m.guideChannels.Count() - 1
if m.channelIndex >= 0 and m.guideChannels[i].id = m.channels[m.channelIndex].id then selected = i
m.channels = data.channels
m.channelIndex = -1
m.previousIndex = -1
for i = 0 to m.channels.Count() - 1
if m.channels[i].id = activeId then m.channelIndex = i
if m.channels[i].id = previousId then m.previousIndex = i
end for
selected = m.channelIndex
if selected < 0 then selected = 0
count = m.guideChannels.Count()
m.guideSelected = (selected + m.guideOffset + count) mod count
m.guideFirst = 0