From 160f74c2947c470386d5530b2c751392e77c3524 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 13 Nov 2026 16:35:11 -0500 Subject: [PATCH] Refresh Roku channels when opening the guide --- README.md | 2 +- roku/README.md | 2 +- roku/components/Guide.brs | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ef6cbb7..1709830 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,6 @@ The tests exercise lineup and guide normalization, server ID persistence, Tunarr ## IPTV channels -Add direct Roku-compatible HLS feeds to `data/iptv/channels.json`. Each entry has a stable lowercase `id`, a positive `number`, a `name`, and a `url`. The file stays local. Restart the bridge with `docker compose restart bridge` after changes, then refresh channels in the Roku app. Tunarr numbers take precedence when a number overlaps, and 99 is reserved for weather. +Add direct Roku-compatible HLS feeds to `data/iptv/channels.json`. Each entry has a stable lowercase `id`, a positive `number`, a `name`, and a `url`. The file stays local. Restart the bridge with `docker compose restart bridge` after changes, then reopen the Roku guide to refresh channels. Tunarr numbers take precedence when a number overlaps, and 99 is reserved for weather. The bridge relays HLS playlists and media over the LAN without transcoding. These channels appear in the retroLabs guide with a live label. Program listings require a separate schedule feed. diff --git a/roku/README.md b/roku/README.md index ad7e848..860305d 100644 --- a/roku/README.md +++ b/roku/README.md @@ -20,7 +20,7 @@ IP or hostname. Use `IP:port` if the bridge uses a port other than `4242`. - **Up / Down** opens the guide on the adjacent channel. In the guide, it moves the highlight without tuning. - **OK** tunes the highlighted channel in the guide. During playback it shows the banner or retries a failed channel. - **Left / Right** moves the guide time by 30 minutes. With the guide closed, Left or Replay returns to the last channel. -- **Star** opens the guide. Press it from the guide for channel refresh and server selection. +- **Right** opens the guide during playback. The guide refreshes the channel list each time it opens. - **Back** closes the guide or menu, then exits from the tuner. The app opens on the guide. The guide scrolls three channels at a time in a full-width guide across the bottom third of the picture, with current and upcoming programming for each row. Channel 99 displays local weather. Playback starts from the live HLS playlist supplied by the bridge. diff --git a/roku/components/Guide.brs b/roku/components/Guide.brs index 967b3ef..6b76dae 100644 --- a/roku/components/Guide.brs +++ b/roku/components/Guide.brs @@ -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