Guide Data Storage

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
MatthewLundberg
Posts: 35
Joined: Mon May 08, 2017 3:57 pm

Guide Data Storage

Postby MatthewLundberg » Sun Feb 11, 2018 12:51 pm

Searching for guide data terms, I am having trouble finding definitive documentation (but I'm sure I've seen it before). I did find this:

viewtopic.php?f=125&t=65784&p=300351&hi ... de#p300351
Rule - no storing or archiving guide data or images.

Guide data may be cached for as long as the data is current (typically 1-2 hours).
Images may be cached for up to the cache duration specified in the HTTP header (typically 24 hours).
Images may not be stored within a recorded file.
As I'm sure you know, Kodi displays a grid-style guide. This means that it pulls the guide for every channel, and can do so for the entire two-week guide duration. My question is, is it allowable to store the guide data in a local database that is not intended to be accessed by any other program? Or is it better to have the PVR pull the entire two weeks of guide data from SD anew, every time it starts up?

Kodi claims to store guide data in its PVR layer (above the PVR plugin itself), for improved startup performance. I'm not sure how effective this is because it's asking the PVR for the same guide data every time it starts up. Storing it in a database used by the PVR itself would reduce network traffic considerably if Kodi is restarted. I don't mind pulling it anew with each restart of Kodi, if that's preferable to you -- the code is much easier that way, but slower for the user.

This would be storage, not archiving. The prior entries would be automatically purged when running or upon startup.

rpcameron
Posts: 633
Joined: Fri Mar 25, 2016 9:55 am

Re: Guide Data Storage

Postby rpcameron » Sun Feb 11, 2018 2:57 pm

I believe that technically it means guide data needs to be retrieved anew whenever Kodi (or the PVR Manager) restarts. Whether Kodi's own cache of this data is in violation will depend upon SD's specific terms with Gracenote ...

One way to alleviate the load/retrieval is to do an initial grab without a channel number in the request: this retrieves 4 hours of guide data for all channels. Then, after that had been retrieved, do your grab for individual channels (perhaps cycling through each channel in increments of 8 hours, to stagger the fill of the guide instead of grabbing all 24 hours or 2 weeks of data for each channel sequentially).

MatthewLundberg
Posts: 35
Joined: Mon May 08, 2017 3:57 pm

Re: Guide Data Storage

Postby MatthewLundberg » Sun Feb 11, 2018 6:09 pm

My plan is to grab the 4-hour data upon startup, then each hour just before the top of the hour. That way it will update with the latest guide data, including whether there is a recording rule (added elsewhere) for the program.

Indeed, it is more friendly for the user to grab the 8-hour data in a channel-centric loop. Right now I am grabbing 8 hours at a time, once per minute. It takes some time to fill out the entire 14 days of the guide. So it would be more user-friendly if it could store that data. But that's also significantly more work, and I don't want to start on it if it encroaches on the TOS.

I'm having trouble finding the TOS for the guide just now though, do you happen to have a link?

rpcameron
Posts: 633
Joined: Fri Mar 25, 2016 9:55 am

Re: Guide Data Storage

Postby rpcameron » Sun Feb 11, 2018 9:11 pm

Here's the link to the forum posting, which is the only real info that SD has made public: viewtopic.php?f=88&t=19230


Return to “Development Support”

Who is online

Users browsing this forum: No registered users and 3 guests