djp952 / pvr.hdhomerundvr

Unofficial Kodi HDHomeRun DVR PVR Client
https://github.com/djp952/pvr.hdhomerundvr/wiki
Other
60 stars 9 forks source link

Provide an option to load/use extended guide data #2

Closed djp952 closed 7 years ago

djp952 commented 7 years ago

It should be feasible to use the channel-specific guide data available from the online backend to feed the Kodi guide rather than just using the small bulk data. The channel specific requests are notably slower and would need to be done in a loop since only the start time can be provided, but it should be relatively easy to satisfy the Kodi guide requests realtime and not feed from the local database at all. The local database and the bulk guide data will still be required to provide the proper channel names and back up the existing queries that join against it.

I'm thinking this can be an option, "Use extended Electronic Program Guide (EPG) data", let the user decide if they want to take the time/network hit to get more guide data. Default will probably be OFF for this.

Initial tests show it's reasonable, but definitely not as fast as I would prefer. On the flip side, Kodi will be dealing with when to load the data and there doesn't need to be a scheduled task to handle it.

djp952 commented 7 years ago

After coding this up experimentally, it's not working out as expected. The guide data load is extremely slow and Kodi does not discriminate when it asks for a refresh; it always asks for the full EPG time period again. As an example, it was taking about 5 minutes to load 4 days worth of guide data for 82 channels from the backend. When the Kodi period expired (set to 30 minutes for testing), it requested a full 4 days worth of data again, just moving the start/end times up by 30 minutes. ugh.

To be truly feasible, I'd have to store the guide data in the database and continue to update it periodically in the background like it is now with the bulk data. Unfortunately, I think this is against the rules laid out by SiliconDust, I'll have to check with them first. (Letting Kodi store it is also probably against the same rules).

Alternatively the per-channel guide data could be used as an extended version of the existing functionality (quick guide + series episodes). Less tracking/caching to worry about and only one web request per channel so it's not as miserable to load. This seems to give about 8 hours of data, which is still an improvement.

djp952 commented 7 years ago

Added option in version 1.0.2 to access the top-level per-channel guide data which exposes about 8 hours worth of information. It takes exponentially longer to load than the bulk data and only provides twice the information, but it's something. Accessing more data using this method would be possible but not realistic based on how much time it takes to query the backend multiple times for every channel.

Closing this issue.