add-ons / service.iptv.manager

Integrate TV and radio channels with EPG data from other add-ons in Kodi PVR.
https://github.com/add-ons/service.iptv.manager/wiki
GNU General Public License v3.0
95 stars 28 forks source link

Groundwork for dynamic updates #93

Closed Lunatixz closed 2 years ago

Lunatixz commented 3 years ago

Schedule indv. addon update times.

Lunatixz commented 3 years ago

@michaelarnauts PLS Let me know your thoughts on this PR and the direction it's going... the idea is that IPTV manager checks hourly for updates and only updates addons individually by its last stop guide meta.

running reload or refresh forces a rebuild...

Since the xmltv files are built clean during refresh my next step requires appending existing guide meta for channels that skipped updating.

I can either parse the existing xmtv file or I was thinking of using a caching mechanism, your thoughts?

michaelarnauts commented 3 years ago

@michaelarnauts PLS Let me know your thoughts on this PR and the direction it's going... the idea is that IPTV manager checks hourly for updates and only updates addons individually by its last stop guide meta.

running reload or refresh forces a rebuild...

Since the xmltv files are built clean during refresh my next step requires appending existing guide meta for channels that skipped updating.

I can either parse the existing xmtv file or I was thinking of using a caching mechanism, your thoughts?

What do you mean with the last stop guide meta? I would update the data anyway (at the requested interval). It's quite common for the add-ons I use to update guide data during the day (due to small scheduling changes).

I'm not sure if the configurable refresh interval should be removed, I think there are usecases why you wouldn't want to refresh every hour.

(Comment from slack): The way I was thinking to go was to keep the latest epg and channels for every addon in a cache folder of iptv manager itself, this way, when a refresh is going on, and one addon doesn't respond correctly, we can still use the old cached data (we can check the timestamp of the cache to not use to old values, maybe up to 3 days or something?). this also opens up the possibility for addons to push new data when the addon wants it, iptv manager will then only process the data for that addon, do the merge based on the cached data, and generate a new xmltv and playlist.

So I think caching all the data that addons provide would be the best way, in the same JSON format as we already received them in. We can just dump the channels and epg to a file based on the name of the addon. This way, we don't need to parse the merged xml or channels, since that will bring a lot of other issues :)