Your Digital Media Has Never Looked So Good

 
User avatar
enter0
Topic Author
Posts: 21
Joined: Thu May 17, 2018 8:39 am

Best practices re: number of user bookmarks to save

Thu Jun 07, 2018 1:24 pm

When storing a new bookmark so that a user can resume a video they have left half watched, I've written a function which checks whether the user has reached an arbitrary maximum number of bookmarks and, if so, deletes the oldest bookmark before saving the new one, so as to not waste huge amounts of registry space with if the user happens to leave every video in the app unfinished.

These registry entries include the deep linking video GUID, info about when the bookmark was saved in UNIX epoch format, and—obviously—the point at which the user stopped watching the video. The latter two are saved in a single string separated by a delimiter character, which I split up using the ifStringOps Tokenize function when I'm processing the data from the registry.

Currently I have the max number of bookmarks set to 7, which seems to me like it generates a list that's small enough not to be overwhelming (the "resume–able" videos are displayed in a "Keep Watching" category on the home grid), while still being large enough to not be entirely useless.

My question is this: I know that there are memory/storage differences between different Roku devices, so would it be beneficial to vary that max bookmarks number depending on the device/model number on which the app is running? In other words, is there any reason to set maxBookmarks to, say, 4 on model number 1XXX and 2XXX, 7 on 3XXX and 4XXX, and 10 on 5XXX? Or am I overthinking this, and the amount of device storage space I'd use on the function itself would cancel out the negligible benefits of doing this anyway?
 
User avatar
squirreltown
Posts: 851
Joined: Sun Apr 21, 2013 2:20 pm

Re: Best practices re: number of user bookmarks to save

Thu Jun 07, 2018 3:36 pm

I believe the amount of space in the registry is 16k per dev ID and is the same on all boxes. 
Kinetics Screensavers
 
User avatar
enter0
Topic Author
Posts: 21
Joined: Thu May 17, 2018 8:39 am

Re: Best practices re: number of user bookmarks to save

Fri Jun 08, 2018 4:56 am

Thanks, I guess it was kind of a silly question—I just was surprised to learn about the significant hardware differences when I got my initial cert results back, so I wanted to make sure I wasn't overlooking a storage question that would present an impediment to my app working well.
 
User avatar
Komag
Posts: 772
Joined: Fri Aug 22, 2014 3:42 am

Re: Best practices re: number of user bookmarks to save

Fri Jun 08, 2018 3:31 pm

I'm sure Roku thinks 16k is plenty of space for that sort of thing, but I have had to compress and optimize like crazy to fit all my save date in there for my action/RPG game, it's been quite a challenge.
 
User avatar
marcelo.cabral
Posts: 349
Joined: Tue Mar 20, 2012 8:53 am

Re: Best practices re: number of user bookmarks to save

Wed Jan 30, 2019 3:31 pm

You can also use the File System, since firmware 8.0 there is a cache area that unlike tmp:/ will be persisted between executions of the channel, and even between reboots if the user has an SD Card on his device. A strategy could be have a limited amount of bookmarks on Registry and an expanded on cachefs:/

https://sdkdocs.roku.com/display/sdkdoc/File+System
 
destruk
Posts: 2679
Joined: Sat Dec 18, 2010 4:58 pm

Re: Best practices re: number of user bookmarks to save

Fri Feb 01, 2019 11:21 am

While you can use cachefs, I wouldn't rely on it saving much of anything as any other channel would have access to it, and when it fills up older data is pushed out to make room for new data, thus the name "cache filesystem".  You would need to check if what you're looking for is there, if it is then use it, if not you won't have it unless you save it again.

Who is online

Users browsing this forum: No registered users and 5 guests