-
Notifications
You must be signed in to change notification settings - Fork 113
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
Fix duplicate watched status in trakt (due to movie in multiple Plex libraries) #477
Fix duplicate watched status in trakt (due to movie in multiple Plex libraries) #477
Conversation
5a252f4
to
a3859fa
Compare
a3859fa
to
694bd79
Compare
694bd79
to
5c2c690
Compare
5c2c690
to
4b01dcb
Compare
read my response: without it operates on a copy: print(type(trakt.watched_movies))
print(3 in trakt.watched_movies)
print(3000 in trakt.watched_movies)
print(len(trakt.watched_movies))
trakt.watched_movies.add(3)
trakt.watched_movies.add(3000)
print(3 in trakt.watched_movies)
print(3000 in trakt.watched_movies)
print(len(trakt.watched_movies))
compare with and without the decorator yourself. |
and please, try not to force push during the review. use git fixup commits instead. use issue status Draft to prevent accidental merges. first it's difficult to see the new changes you make, if you overwrite everything each time, and github has troubles as well, as all line comments get hidden somewhere. the comments i left are no longer in context of the lines i commented. I recommend using git fixup (a simple wrapper for my typical flow is like this:
and when done with the review (or just too messy and want to clean up):
|
Ok thanks, i'll have to learn this. |
4b01dcb looks accurate now. lets wait for user feedback. |
Some of the discussion is on the commit: that discussion is not reachable from pull request due force pushes. at least i can't find it. |
The idea of this PR :
The trakt
watched_movies
list used during sync is created when syncing the first movie of the first library.It is later read to know the watched status of other movies, but it is memoized so not fetched from trakt server. Therefore, it can give a wrong not-watched status when a movie is scanned for the second time in the same sync session.
The idea is to update this list each time a movie is marked as watched in trakt.
With this list up-to-date, the script will know the correct watched status of a movie even if it has already been scanned in the same session.
PlexTraktSync/plex_trakt_sync/trakt_api.py
Lines 90 to 98 in 83ded35
fixes #476