Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joetesta
Roku Guru

SetContentListSubset and grids with too many results

Greetings -
I'm working on a channel that has grid screens with a potentially huge number of results. Just in testing I saw that it was taking way too long to load and crashing the whole roku, so I drastically cut back on the number of elements just to get the channel functional. Now I'd like to consider using "SetContentListSubset" or some other function to allow partial grid loading or pagination.
I thought I'd seen people discussing / handling this somehow in the past, but now that I search the dev forum for "SetContentListSubset" there are only a handful of responses and none that figured out / explain how to use it.
Does this function help with large grids; is there an example? Or is there a better way to handle huge grids and partial loading?
tyvmia,
Joe

Update: perhaps this post will get me started: viewtopic.php?f=34&t=22547&p=157968&hilit=pagination#p157968
A concern would be going back up - the content list needs to be overwritten in either direction, since I assume based on testing that if we just keep adding to the screen as they scroll down, it will eventually get too large and crash the whole roku.
aspiring
0 Kudos
6 REPLIES 6
TheEndless
Channel Surfer

Re: SetContentListSubset and grids with too many results

If you have the full count in advance, then you can pass in a content list with "invalid" entries (just set contentlist[maxcount] = invalid), then in the onListItemFocused event, check for an invalid entry X number of entries to the left or right of current, and use that to trigger the load of the next page of results.

My Instant Watch Browser has some grids with multiple thousands of entries, and I've never run into a crashing issue with it, so that shouldn't be an issue.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
joetesta
Roku Guru

Re: SetContentListSubset and grids with too many results

"TheEndless" wrote:
If you have the full count in advance, then you can pass in a content list with "invalid" entries (just set contentlist[maxcount] = invalid), then in the onListItemFocused event, check for an invalid entry X number of entries to the left or right of current, and use that to trigger the load of the next page of results.


Thanks TheEndless - I'm back looking at this now and I'm a bit confused when you say "left or right"; since this is a grid screen isn't it really "down" where the invalid entries would be? Or do you load (and set the names for) every row and just load the items later?
I haven't tried yet but I was also wondering if I could load all the data into roku's memory and just set the rows as needed, or if I'd see the same issue (crashing) as when I tried to set all the rows. I need to experiment with this and wish there was a working example somewhere to start with. I just can't figure out how it should work in light of the crashing I was seeing with the whole grid loaded, and I'm thinking it must need to overwrite and use the same rows in memory to avoid this..?
thanks for any advice,
Joe
aspiring
0 Kudos
TheEndless
Channel Surfer

Re: SetContentListSubset and grids with too many results

SetContentListSubset sets the partial contents of a given row, hence the "left or right". I thought your concern was that your rows had too many entries, not that you had too many rows. As I mentioned in my first response, the Instant Watch Browser has some grid screens that have literally thousands of entries across many rows, and I've never run into any crashing issues as a result, so I don't think it's the amount of content that's causing your problem. Is it possible there's one row in particular that's triggering the crash? Maybe there's some specific content that's triggering it once it's scrolled into view...?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
joetesta
Roku Guru

Re: SetContentListSubset and grids with too many results

"TheEndless" wrote:
SetContentListSubset sets the partial contents of a given row, hence the "left or right".

Thanks! I just realized that too. Because of the way this particular grid works, I don't think the SetContentListSubset will be useful - my rows are limited to under 20 items each, so getting each row is not a big deal. It was that I had at least a few hundred rows (which creates another navigation issue, once they go down several dozen rows, do they really have to go all the way back up to get out? I'll need to give them an "exit" option)

"TheEndless" wrote:
As I mentioned in my first response, the Instant Watch Browser has some grid screens that have literally thousands of entries across many rows, and I've never run into any crashing issues as a result, so I don't think it's the amount of content that's causing your problem. Is it possible there's one row in particular that's triggering the crash? Maybe there's some specific content that's triggering it once it's scrolled into view...?

I don't think it's one particular row, since this same content is already used elsewhere (although it is possible). It happened after I loaded a huge grid screen and then launched a video from there - roku just rebooted with no error in the telnet terminal. I guess it could be either the amount of data I tried to load into memory or the number of elements on the grid screen or something in between. I was just thinking about a way to test the limits and see what I need to do to make sure the channel doesn't crash.

As of this moment, I'm thinking of loading 5 rows at a time then dynamically load more when the user moves down. One big question is whether "load" will mean from the API or from roku's memory; or "how much can / should our app store in memory vs. how frequently should roku make API calls"
aspiring
0 Kudos
Indie
Visitor

Re: SetContentListSubset and grids with too many results

While this might not help him, I am certainly interested in how to use SetContentListSubset. I currently populate my gridscreen with a for loop like this:
for i = 0 to namescount-1 step 1
screen.SetContentList(i, GetPlaylist(contentlistchannels)[0]) --- The GetPlaylist fetches json and runs a for each to get the info. The contentlistchannels is info from another json that maintains a channel list.
end for
This is very slow due to the fact that we have about 32 channels/rows with about 1500 titles, and have to parse a different json file for each row. Also, you cannot select a film until the entire grid is loaded. I understand what the SetContentListSubset is supposed to do, but I am new to BS and just cannot seem to make it work. Any help would be greatly appreciated.

Perry
Perry Garvey
IndieFlix - Video Ingestion Coordinator
0 Kudos
ramakanth
Visitor

Re: SetContentListSubset and grids with too many results

Hi,
Can anyone please post a code snippet to show the working of pagination in the roGridScreen. it would be very helpful.

Thanks
0 Kudos