How best to cache series information and history? #372
Unanswered
MaxHasADHD
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
I've had a similar issue as you in my discussion: #317 To solve the issue, that a user marks an episode as watched in the past, I would suggest adding the ability to query the watched endpoint via the last_update timestamp, with start and end timestamps provided. This way, only the relevant data would be fetched, greatly reducing the amount of data transmitted during the sync process. I believe this improvement would greatly enhance the efficiency and ease of use of the API, and would be of great benefit to many other users as well. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a TV tracker app that shows when series air, all of their seasons and episodes, and the users history for those series. On sync I fetch (in order):
sync/last_activities)users/hidden/progress_watched)sync/watched/shows?extended=full)sync/watchlist/shows?extended=full)sync/ratings/episodes)shows/{trakt_id}/seasons?extended=full,episodes)This is a lot of data to fetch, especially after most of it has been cached. There isn't much I can do for first sync, and on subsequent syncs I use
last_activitiesto figure out if I need to fetch history or the watchlist, etc. Sync can still take a long time though because I fetch the users full history. I do this because the user may mark an episode as watched in the past before the last sync, or marked something as unwatched. I'm also fetching full series seasons, whereas once cached I really only need to refresh the current season and watch out for new seasons. That could improve speed especially for long-running series like game shows, SNL, etc since episodes don't really change once aired.I would love to know how the Trakt app handles first and subsequent syncs, the best way to fetch history and keep it accurate, and which endpoints to call to optimize fetching episodes and seasons.
Beta Was this translation helpful? Give feedback.
All reactions