wilmardo / migrate-plex-to-jellyfin

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

Added support for multiple agents, but removed support for series #22

Closed guillaumematheron closed 11 months ago

guillaumematheron commented 2 years ago

I believe the default now is for plex collections to use the plex agent. Therefore there is no straightforward way to look for matches in imdb or another shared database.

This PR solves this issue thanks to the matches() method:

plex_movies = plex.library.section(plex_movie_lib)
for m in plex_movies.search(unwatched=False):
    for agent in agents_movies:
        agent_matches = m.matches(agent=agent['plex'])

This also adds support for multiple agents, for instance themoviedb could be used to match some movies and imdb for others. As far as I know this works even if these libraries are not enabled in the plex server, since this function call triggers match attempt.

On the other hand, I could not find a suitable solution for series, since individual episodes don't have the matches method. Therefore I remove support for series entirely for now.

Various other improvements include:

The code is still not very polished so I understand if you prefer not to pull it, but I hope others can benefit from my tweaks.

wilmardo commented 11 months ago

This problem has now been solved by using path matching as proposed in this PR: https://github.com/wilmardo/migrate-plex-to-jellyfin/pull/24

Will close this now, thanks for taking your time to submit the PR and sorry I have let this linger for so long <3