Forum Discussion

joetesta's avatar
joetesta
Roku Guru
12 years ago

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.

2 Replies

  • "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
  • "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"