I am trying to implement LazyLoaded Paged out Programs fetching for each Channel Row, I would really appreciate if someone from Roku Team can point me in the right direction, as it doesn't call the Row Channel Programs Fetching ContentHandler more than once.
My code for Fetching the Row Content for each Row set in GetContent of TimeGrid Root ContentHandler is as follows
sub GetContent()
response =readInternet.getToString()
json = ParseJSON(response)
rootChildren = {
children: [],
} ' channels array
for each channel in json.arrayChannels
' create a node for the channel and set its metadata fields
channelNode = CreateObject("roSGNode", "ContentNode")
channelNode.title = channel.title
channelNode.start_date = channel.start_date
channelNode.end_date = channel.end_date
channelNode.thumbnail = channel.thumbnail
channelNode.HDSMALLICONURL = channel.thumbnail
channelNode.AddFields({
HandlerConfigTimeGrid: {
name: "ChannelProgramsFetcher",
fields: {
day: 0,
pageSize: 300,
hasMore: true
}
},
})
rootChildren.children.Push(channelNode)
end for
m.top.content.Update(rootChildren)
end sub
Below is the code for GetContent() which is defined in the ContentHandler - ChannelProgramsFetcher
sub GetContent()
response =readInternet.getToString()
json = ParseJSON(response)
programNodes = {
children: [],
HandlerConfigTimeGrid: {
name: "ChannelProgramsFetcher",
fields: {
day: m.top.day + 1,
pageSize: 300,
hasMore: true
}
}
}
for each program in json
' create a node for the program and set its metadata fields
programNode = {}
programNode.title = program.title
programNode.description = program.description
currentTime.FromISO8601String(program.start_date)
programNode.playStart = currentTime.AsSeconds()
programNode.playDuration = program.duration
programNodes.children.Push(programNode)
end for
m.top.content.Update(programNodes)
end sub
Even with the hasMore and pageSize fields added, the ContentHandler for fetching Programs for Row only gets called once, looking forward to hearing back from you,
Thanking you in advance, have a blessed day!