trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io
185 stars 7 forks source link

watched items (episodes) #351

Open mlaggner opened 2 years ago

mlaggner commented 2 years ago

I have a problem with the endpoint /sync/watched/shows with episodes which are not in the same order as in trakt.tv (aired vs. dvd order for example).

When you sync your local watched state to trakt.tv, you can use the endpoint /sync/history along with the episodes key (and using the IDs from the episode rather than season/episode number) -> this works as expected

But when you sync the trakt.tv watched state to your local library, you only have the endpoint /sync/watched/shows which offers the watched state of your episodes in the trakt.tv order (via seasons -> episodes). Here are no IDs sent to the caller where we could do an ID lookup.

Lets assume we have the TV show Firefly in DVD order where the first episode is Serenity (https://thetvdb.com/series/firefly/episodes/297999) but in aired/trakt.tv order this is The Train Job (https://thetvdb.com/series/firefly/seasons/official/1). When calling the endpoint /sync/watched/shows the watched state from The Train Job (offered in the response as S01E01) gets synced to the local episode which is Serenity (S01E01 in DVD order).

Possible solutions? you could offer an own endpoint to get all watched episodes - e.g. /sync/watched/shows - which offers the IDs of the episodes too (like you already offer in /sync/history), so we can match the episodes by ourselves via the episode IDs

rectifyer commented 2 years ago

Good point and I will look into this more, possible with an extended param on that method.

The workaround for now would be to get the seasons + episodes for the show, then do a local comparison of the episode number. That would find the complete episode object with IDs.

myron0815 commented 1 year ago

hejj... is there any update on this?
Matching by ID ootb would be really helpful :)

Thanks for the great work!

michaldrabik commented 1 year ago

@rectifyer May I also ask If there is any progress on adding IDs of episodes with extended param here? What also could help is always including all the episodes but with plays: 0 and last_watched_at null or gone. In case episode has not yet been watched.

I'm asking because recently I discovered that due to season/number combo and possibility of it changing there is a chance of constantly spamming Trakt account with new plays.

This is because since the episodes that are not watched are not included in the response at all - it is not clear if the episode is actually unwatched or something happened in the season/number data in the meantime.

Example:

Thanks for any updates on that : )