In order to display seasons and episodes in the UI, as well as sync their watched status, they need to be efficiently fetched and cached from TMDB. The following logic will be used:
On fetch of TV show (GetOrCreateByTmdbID()) the service will check if the show has completed.
If not, seasons and episodes will be synced.
First, the last cached season will be checked, and updated if necessary.
All episodes of the last cached seasons, and newer seasons will be fetched from TMDB and updated.
Consumers will have to get seasons and episodes through the TvService to ensure that this logic is executed whenever these models are requested.
What is required?
In order to display seasons and episodes in the UI, as well as sync their watched status, they need to be efficiently fetched and cached from TMDB. The following logic will be used:
GetOrCreateByTmdbID()
) the service will check if the show has completed.Consumers will have to get seasons and episodes through the
TvService
to ensure that this logic is executed whenever these models are requested.