Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync watched endpoint advice needed #233

Open
michaldrabik opened this issue Nov 23, 2020 · 1 comment
Open

Sync watched endpoint advice needed #233

michaldrabik opened this issue Nov 23, 2020 · 1 comment

Comments

@michaldrabik
Copy link

michaldrabik commented Nov 23, 2020

Hi Trakt team,
I'm wondering what is the better way to use this endpoint from your point of view.
We are talking about: https://api.trakt.tv/sync/watched/shows

The case is initializing user's collection in the app so basically one-time import Trakt.tv account progress and shows data.
Lets assume this user has been using Trakt for a long time and has a big collection 500-1000 shows.

Should I call the endpoint single time with ?extended=full which might take a very long time and possibly result in a timeout.
Or should I call it without it and then fetch all the show details needed using show details endpoint sequentially repeated 500-1000 times?

Thanks,
Mike

@VaslD
Copy link

VaslD commented May 2, 2021

From a "best programming practice" point of view you shouldn't cache data that you don't know when you'll need. Which means you should first use non-extended API to pull the full watch history, and only retrieve show details when user specifically navigates to a page or otherwise performs an action that requires say Overview and Genres. I doubt the user would be somewhat a maniac and open detail pages on their 1,000 watched shows. Even if they do so, calling the API 1,000 times in a span of about half an hour (assuming they're on super-fast Internet and get done reading every show detail in 2 seconds) is better than calling 1,000 APIs concurrently or call an extended API with 1,000 items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants