wilmardo / migrate-plex-to-jellyfin

Migrate watched status from Plex to Jellyfin
99 stars 22 forks source link

Fix for #10 #12

Closed clonex10100 closed 4 years ago

clonex10100 commented 4 years ago

Fixes #10.

wilmardo commented 4 years ago

Thanks for opening the PR! Could you provide some more background on the fix? A quick Google reveals that this seems the same as the previous:

func(**{'type':'Event'}) is equivalent to func(type='Event')

https://stackoverflow.com/questions/5710391/converting-python-dict-to-kwargs

And when I look at the Usage examples the current implementation seems right to me:

# Example 1: List all unwatched movies.
movies = plex.library.section('Movies')
for video in movies.search(unwatched=True):
    print(video.title)

https://github.com/pkkid/python-plexapi/tree/master#usage-examples

I am in no way bashing your fix, I am just trying to understand why it works :heart:

clonex10100 commented 4 years ago

The key change is from unwatched to episode.unwatched.

The reason for that when I do plex_tvshows.filterFields() all of the filter fields are episode. instead of just , which is causing the "Unknown filter category: unwatched" error for me.

The reason I have **{ is because you can't do plex_tvshows.search(episode.unwatched=False) because of the dot.

wilmardo commented 4 years ago

Thanks! I looked over the fact the the unwatched key moved to the episode dict. Now this change makes way more sense, thanks for explaining!