-
Notifications
You must be signed in to change notification settings - Fork 108
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
Sync watched status and ratings with Plex Discover #1676
base: main
Are you sure you want to change the base?
Conversation
Many movies search on Plex Discover fail with the 30 items result limit. Examples of failed Plex search with
|
e3cacdf
to
6006102
Compare
6006102
to
193a1f2
Compare
193a1f2
to
9fa006b
Compare
This feature could help to have fast 2-way sync with Plex Discover : |
season = r[index]["number"] | ||
number = None | ||
ids = r[index]["ids"] | ||
yield trakt_types[index]( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
point of yield
in the other method was if you used @flatten_dict
. how does it work without it for you? not tested code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reporting this.
I need to dive in this code again but have no time for this at the moment.
It was tested successfuly on my library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you put the generator to set():
set(self.trakt.ratings.items["movies"])
it's what the @flatten_set
would do
|
||
return ratings | ||
|
||
@flatten_dict | ||
def ratings(self, media_type: str): | ||
"""Yield trakt id and rating of all rated media_type""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method does not yield
. the whole method returns a dict
. see @flatten_dict
decorator
items = set(self.trakt.watched_movies.values()).union( | ||
set(self.trakt.ratings.items["movies"]) | ||
) | ||
# items is a set() of trakt.movies.Movies already watched or rated (can a user rate without watch?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can definitely rate movie without watching it:
title=title, | ||
show=show, | ||
season=season, | ||
number=number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
season
and number
could be undefined. you should probably use elseif rather another if and throw for unsupported index
value.
🚧 Work in progress 🚧
Adds sync of watched status and ratings between Trakt and Plex even if you don't have the media in your Plex library.
Objective is to sync watched status of :
and ratings of :
both ways between Trakt and Plex items not in the library. This feature doesn't work with managed users.
Side effect : when disabling a trakt watched status or rating, it will be back at next sync because Plex keeps it in its cloud database. Users may think it's a bug (see #1080).
Impossible to rate medias from Plex Discover pkkid/python-plexapi#1137
To test this draft PR at your own risks (remember the --dry-run option ) :
true
Currently, sync with Plex Discover is very slow (1 it/sec) because batch is not implemented yet for Plexapi Discover items (pkkid/python-plexapi#1090).
Do not hesitate to test and give feedback if you feel confortable with testing, so we can make this feature live asap 👍
closes #1142