-
Notifications
You must be signed in to change notification settings - Fork 106
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
Duplicate when multiple library with same movie/show #476
Comments
Can you give more details please.
Yeah, every movies are synced over and over every day, even if you just watch them once. 😄
Ok which one is the first to sync then ? I think I understand the problem but I'd like you to tell exactly what you want. Refs: |
you can explain the scenario by including "inspect" output of both movies. the command should print the play history of your items.
where movie_id is XXX from the url: as likely what is happening is that you watched movie with imdb id=123 in one library, and on next sync run the same movie with the same imdb id is matched and marked as watched as well. I don't think it's recorded as a duplicate match in trakt, but in plex with the time of the sync. it's indeed unclear what is the synced twice meaning here. adds two plays in trakt? marks both played in plex? adds multiple plays to one of the plex items? |
there's an easy workaround if you want to sync just watch status from plex to trakt:
use sync command only for collection updating, not watches. |
perhaps it's possible to make PlexTraktSync to distinguish the same imdb match but different quality after we added the collection metadata support: |
Okay so to describe the issue and what I expect to happen more precisely: I have two movie libraries on my Plex Server, "Movies" and "4K Movies". Let's say I watch "Avengers: Endgame" from the library "Movies", but I also have "Avengers: Endgame" in the library "4K Movies". So even though I only watched the movie once from the library "Movies", in Plex, "Avengers: Endgame" is marked as watched in both libraries "Movies" and "4K Movies". So when I run PlexTraktSync afterwards, it first parse the library "4K Movies", and when it sees "Avengers: Endgame" in this library is marked as watched, it tells Trakt that to mark it as watched. After it finished parsing "4K Movies", it parses "Movies", and sees "Avengers: Endgame" in this library again marked as watched, so it tells Trakt to mark it as watched again. So at the end you can see in https://trakt.tv/users/_username_/history that there is two records of "Avengers: Endgame" on the same date. One workaround I can think of is to also record the time when the movie/episode was watched in the cache, and when PlexTraktSync finds a movie that is watched, it should compare the time when it was watched with the record before telling Trakt, to prevent "double syncing" of the same watch session. |
For now, that is the expected behaviour. You have watched the movie, no matter on which device or where or when (trakt->plex sync) or how. |
@twolaw yes, I understand that that is expected behavior. But the issue is that in https://trakt.tv/users/_username_/history, synced items are shown twice, which is weird when the movie "Avengers: Endgame" only showed up once in last_update.log. |
Upon further inspection, the line Console:
last_update.log:
|
This is normal, ratingKey is the Plex id. One for your HD version and one for your 4K version.
I agree, see my previous comment with a screenshot. |
Maybe I misunderstood you, but I don't think it is syncing the watched status by PlexTraktSync platform in Plex back to trakt. If a movie is only available as HD in my Plex and not 4K, it'll only show up in trakt once. Only those that I have two versions of, will show up twice. |
@imjuzcy you haven't provided inspect command output asked previously. |
@twolaw #168 doesn't solve anything. there's no code that checks the platform. however, as I already wrote, this issue problem could be solved by matching collection parameters: |
So to systematically reproduce the issue:
Console output:
last_update.log:
./plex_trakt_sync.sh inspect 328637:
./plex_trakt_sync.sh inspect 328597:
./plex_trakt_sync.sh inspect 328618:
|
Maybe I'm missunderstanding but I think it's a bad solution because it could prevent to sync genuine watched status.
Is it possible to add code to detect platform PlexTraktSync in Plex watched status ? That would be the solution imho. |
@twolaw here's an example of using history: however, history works only for owned servers. for example, in the guest server, I get permission denied exception. |
I wrote something wrong :
Script does NOT send another watched status : PlexTraktSync/plex_trakt_sync/sync.py Lines 58 to 59 in de33310
PlexTraktSync/plex_trakt_sync/media.py Lines 74 to 75 in de33310
Other solution, update trakt watched_movies list :
PlexTraktSync/plex_trakt_sync/trakt_api.py Lines 89 to 96 in de33310
|
please don't abuse |
@imjuzcy can you try this please : |
Just tested it and it works. No more movie showing twice in Trakt. |
Show episodes are still showing up twice in Trakt's history with sync. |
I know, i did not create the episode part for this. |
Try this PR #482 with watched episode(s), then with watched season(s) and then with full watched show(s) please. |
I tested all three cases (one watched episode, one watched season, and one watched full show), the first library it sync successfully, and then when it goes to the second library, it still synced one episode and then encountered an error. First sync when there is nothing to sync:
When there is one episode to sync:
When there is one season to sync (S01E01 has been watched and synced before this, so it's normal that it is not synced here):
When there is whole show to sync (S01E01 has been watched and synced before this, so it's normal that it is not synced here):
End effect is the first synced episode is shown twice is trakt, because it is interrupted by the |
My bad, the line should be |
Error is not there anymore, but episodes/seasons/shows are still synced twice. Full watched season sync:
|
Unpack problem fixed. |
It's still the same |
Ok I managed to reproduced your bug, fix it and successfully test the fix. |
Yes, it is working as intended now. No more double syncing. |
The problem
A description of what the bug is, including a complete traceback (if applicable)
When a movie is in two or more libraries, for example "Movies" and "4K Movies" (which I think is quite common for people to have), it is synced twice in total, once for each library, even though the movie had only been watched once.
Expected behavior
Only sync once if same movie/show is present in two or more libraries.
Steps to reproduce the behavior
Sync a show or movie that is present in two or more libraries.
Workarounds
Exclude all but one library of the same type, but this would mean if a movie is only in a library that is excluded, it won't be synced.
Environment
The text was updated successfully, but these errors were encountered: