Enable favourite filtering on TV Guide

This commit is contained in:
Neil Burrows 2021-08-01 09:49:08 +01:00
parent 10ca08bdf8
commit e10cf817c5
6 changed files with 20 additions and 4 deletions

View File

@ -328,6 +328,7 @@ sub showTVGuide()
m.top.signalBeacon("EPGLaunchInitiate") ' Required Roku Performance monitoring
end if
m.tvGuide.observeField("watchChannel", "onChannelSelected")
m.tvGuide.filter = m.options.filter
m.top.appendChild(m.tvGuide)
m.tvGuide.lastFocus.setFocus(true)
end sub

View File

@ -30,7 +30,7 @@ sub loadItems()
' do nothing
else if filter = "Favorites"
params.append({ Filters: "IsFavorite" })
params.append({ isFavorite: true})
params.append({ isFavorite: true })
end if
if m.top.ItemType <> ""

View File

@ -7,11 +7,13 @@ sub loadChannels()
results = []
params = {
UserId: get_setting("active_user")
'limit: m.top.limit,
'StartIndex: m.top.startIndex
UserId: get_setting("active_user"),
}
if m.top.filter = "Favorites"
params.append({ isFavorite: true })
end if
url = "LiveTv/Channels"
resp = APIRequest(url, params)

View File

@ -4,6 +4,7 @@
<interface>
<field id="limit" type="integer" value="" />
<field id="startIndex" type="integer" value="0" />
<field id="filter" type="string" value="All" />
<!-- Total records available from server-->
<field id="channels" type="array" />

View File

@ -28,6 +28,17 @@ sub init()
m.channelIndex = {}
end sub
sub channelFilterSet()
print "Channel Filter set"
if m.top.filter <> invalid and m.LoadChannelsTask.filter <> m.top.filter
if m.LoadChannelsTask.state = "run" then m.LoadChannelsTask.control = "stop"
m.LoadChannelsTask.filter = m.top.filter
m.LoadChannelsTask.control = "RUN"
end if
end sub
' Initial list of channels loaded
sub onChannelsLoaded()
gridData = createObject("roSGNode", "ContentNode")

View File

@ -18,6 +18,7 @@
</children>
<interface>
<field id="watchChannel" type="node" alwaysNotify="false" />
<field id="filter" type="string" value="All" onChange="channelFilterSet" />
</interface>
<script type="text/brightscript" uri="schedule.brs" />
</component>