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

Show episodes marked as watched in trakt not being synced to jellyfin on import task #190

Closed
h3llrais3r opened this issue Nov 26, 2022 · 2 comments · Fixed by #191
Closed

Comments

@h3llrais3r
Copy link
Contributor

h3llrais3r commented Nov 26, 2022

I recently moved from kodi to jellyfin and want to import my watched status from trakt to jellyfin.

I have been doing some analysis already myself and it seems that the import from trakt to jellyfin is not working for shows/episodes that are not aligned between tmdb and tvdb.

This most likely has been the result of the switch in trakt from tvdb to tmdb.
Quite a few series are split in seasons on tvdb, while on tmdb they are not.
I have the most issues with anime series, as they are typically split up in a lot more seasons on tvdb.
Since I'm maintaining my library via sonarr, which uses tvdb, my files are organized with the tvdb seasoning.

Example: Inuyasha
trakt: https://trakt.tv/shows/inuyasha/
tmdb: https://www.themoviedb.org/tv/35610-inuyasha/seasons (2 seasons)
tvdb: https://thetvdb.com/series/inuyasha (7 seasons)

All shows have been watched in the past from kodi (when trakt was still using tvdb).
image
This is tmdb seasoning:
image

When I'm now importing from scratch in jellyfin, only the 26 episodes from season 1 are imported and the 26 episodes from season 2 (tmdb seasoning) as those are the only ones that are matching between tmdb and tvdb.
image

When looking at the code, it seems that the problem comes from the fact that there is first a check on season number matching...
While looping over all episodes in jellyfin (1) if will normally at least find a match in trakt if it's watched (2), but the check for season match (3) will never return a match for seasons that exist in tvdb, but not exist in tmdb. (For example: season 3 till 7 don't exist in tmdb so the check will return no match and the check for episode doens't happen)
image

Maybe a proposal to work the way around:
Why not looping all watched episodes in trakt and then try to find a match in jellyfin?
I think we also need to use the history api from trakt, as this is returning more details for the watched episodes.
image

As you can see, all episodes id's (tvdb, imdb, tmdb, ...) so I think it's easier to find a match with the episodes in jellyfin. Using the season and number, will always cause issues if they are not the same across the indexers.

I hope it's clear what I'm trying to say and I really hope this could be solved.

I might look for a solution myself (I'm a developer) but haven't been coding in dotnet for the last 20 years :(
But if I manage to setup a build environment, I might try to fix it myself and make a PR. ;)
But I don't know the jellyfin code yet...

@Shadowghost
Copy link
Contributor

I won't have the time to look at it over the next next week, but I'll look at it later on.
Thanks for the research and proposals!

@h3llrais3r
Copy link
Contributor Author

h3llrais3r commented Nov 28, 2022

Have been digging inside the code this weekend and I found a solution. Trying it out but it seems promising. 😆
Edit: PR created. 😉

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

Successfully merging a pull request may close this issue.

2 participants