Sync watched status and ratings with Plex Discover#1676
Sync watched status and ratings with Plex Discover#1676simonc56 wants to merge 7 commits intoTaxel:mainfrom
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.
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.
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.
you put the generator to set():
set(self.trakt.ratings.items["movies"])
it's what the @flatten_set would do
|
|
||
| @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.
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.
you can definitely rate movie without watching it:
| title=title, | ||
| show=show, | ||
| season=season, | ||
| number=number, |
There was a problem hiding this comment.
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 pushingkarmaorg/python-plexapi#1137
To test this draft PR at your own risks (remember the --dry-run option ) :
trueCurrently, sync with Plex Discover is very slow (1 it/sec) because batch is not implemented yet for Plexapi Discover items (pushingkarmaorg/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