Stremio / stremio-core

⚛️ The Stremio Core: types, addon system, UI models, core logic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PullNotifications calls optimization

elpiel opened this issue · comments

Problem

Currently on every windows Focus we call the PullNotifications action of core. This is excessive amount of call to the addons api when really, we can expect a maximum of 1 or 2 times per day to have newly released episodes for a movie series.

Solution

Make the call to PullNotifications less often, ideally no more than 2-3 times per day.

https://github.com/Stremio/stremio-web/blob/4c95cf5672fd7531c07f54d31967cfab5424c0ff/src/App/App.js#L113-L138

Is there a timestamp of this call saved anywhere?
Maybe we could save a timestamp of the last call in the localStorage and condition it to fire only every 6 or 12hours that way we could limit the calls.
Would that be a valid solution?

Yes, we will implement something similar but we've decided to move this logic to stremio-core instead of each app having to implement this logic themselves and test each implementation on it's owm.

I'm moving this issue to https://github.com/Stremio/stremio-core

This was improved by checking if only mtime has changed and skips updating the whole LibraryItem when it's the only field changes in #571