Closed SebbeJohansson closed 8 months ago
didn't know you can submit date when adding rating... does trakt api support it?
Indeed, Trakt API have rated_at
value when adding a rating.
"movies": [
{
"rated_at": "2014-09-01T09:10:11.000Z",
"rating": 5,
"title": "Batman Begins",
"year": 2005,
"ids": {
"trakt": 1,
"slug": "batman-begins-2005",
"imdb": "tt0372784",
"tmdb": 272
}
},
{
"rating": 10,
"ids": {
"imdb": "tt0000111"
}
}
]
@glensc All ratings you have ever created have a date so I just assumed! 😁
this app doesn't send the date, trakt just assumes current date. i have not looked does trakt api support sending date.
@glensc yes it does. @simonc56 included the whole body that you can send before and that includes "rated_at".
Now the second part needs to support it as well. Does plex offer date when rating was made?
@glensc I have no idea. I took a quick look in PyTrakt and found this: https://github.com/moogar0880/PyTrakt/blob/8a6d4f168a858447014fb4c2c0efceb47b30ebb7/trakt/sync.py#L40-L55
For me its just down to trakt supporting it. Plex doesn't display the ratings in a chronological order, so its not a big deal (for me) if plex doesn't have the correct date. Trakt: Plex:
@SebbeJohansson your response does not make any sense. what date would you send to trakt then if plex doesn't provide rating date? current date? but that's the existing behaviour already!
@glensc Plex does have dates, it just doesn't display it anywhere. Sorry I wasn't clear. Since plex doesn't have a thing to display the date, it doesn't matter what the date inside of plex is except for when syncing to trakt.
You can try this PR at some point:
I could not test myself as trakt.tv seems to have availability issues.
Expected behavior
I expect only new ratings to update the date. If the rating is set to the same rating as it is already in trakt it makes no sense to re-set it.
In fact. this app does not update rating if rating is already in sync:
so, you could sync one way first: trakt to plex, then it will not overwrite the historic values.
Could it be worth it to have a warning or something similar? I doubt I'm the only trakt user who cares about their dates and historical data.
Warning about what?
That if you run it like I did (default config) all ratings in trakt will get a new date. Atleast until a fix is tested and released.
Um, why bother? or you are saying that the same can happen after the PR I created? Did you test it?
Um, why bother? or you are saying that the same can happen after the PR I created? Did you test it?
Um, why bother? or you are saying that the same can happen after the PR I created? Did you test it?
and again: this app does not overwrite ratings that are already there with same value (I linked you exact code that skips). so overwrite can only happen if your plex had different values. it's expected to overwrite as in default config plex has priority. if plex did not have ratings, there would not be any ratings present to sync to trakt.
are you saying something else happened?
Haven't been able to test the PR. But if you think that it fixes the issue then I guess it's no need to add any docs about it. Just sounded like it might take a long time until the code is in the app, while a change to the Readme takes just 2 minutes.
My plex had no rating at all when I synced with default settings, while trakt had thousands. This has happened twice for me with two different installs and plex accounts. So I'm not convinced that what you think is true. Sadly Im not gonna be able to test with fresh accounts again for some time.
I myself create backup with this tool:
luckily I never needed it to restore anything, so I'm not sure how to use the backup :)
@SebbeJohansson regarding warning, sure, send a pr if it can cause overwrite, and then can discuss how can it be fixed
Confirmation
The problem
Running the script with the default config file causes all ratings in Trakt with the same value as in Plex to have a new date set as when it was first run. This is not ideal for historical references. For me personally this means that all the dates for any ratings I've done for the last 10 years are now wrong.
This problem is probably only a thing if you have the same rating set in both applications either manually or by a different application/install of the same application.
Steps to reproduce the behavior
docker-compose run --rm plextraktsync sync
Error trace / logs
No response
Expected behavior
I expect only new ratings to update the date. If the rating is set to the same rating as it is already in trakt it makes no sense to re-set it.
Inspect of problematic items
No response
Workarounds
The only option for me right now is to NOT sync ratings at all to trakt.
Install method
docker-compose
Config file contents
Version
0.28.18
Python Version
3.12.2
Plex Server Version
1.32.8.7639-fb6452ebf,
Operating System and Version
Ubuntu 20.04