wilmardo / migrate-plex-to-jellyfin

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

Total rework of the match logic: Use pathnames instead of providers #24

Closed antifuchs closed 11 months ago

antifuchs commented 1 year ago

The current version of this migration tool will look at every media item in two libraries ("the" TV and "the" Movies plex library), extracts the "provider IDs" and then tries to match it to any media entry on the jellyfin side. That works until the providers get out of sync (e.g. as of a few years ago, when Plex started making their own metadata provider).

So instead, this PR tries to cover a wholly different method that should work for most (but certainly not all!) use cases for migration: It extracts the filenames underlying each media entry, then matches those file names on the jellyfin side. If you're migrating from plex to jellyfin on the same machine and the paths stay the same, this is likely going to match just about everything in both libraries.

This approach also has the advantage that it no longer requires specifying "the one" movie and TV library section on the plex side: Instead, it asks Plex for each library section and just goes through them all.

The PR also adjusts the logging to use loguru, which results in far more detailed and legible log messages.

antifuchs commented 1 year ago

I believe this addresses #17.

wilmardo commented 1 year ago

Thanks for the PR! <3

I hope to find some to time to go trough this in the coming month :) I assume you have already just this successfully for your own migration?

antifuchs commented 1 year ago

I did! This did work quite well & precisely too (:

ProjectSynchro commented 1 year ago

Can second this working correctly, worked like a charm for my own migration :)

PhotexMedia commented 1 year ago

Also confirmed that this is working great with no issues, this will be a very useful tool with a lot of people migrating soon.

Trihedraf commented 1 year ago

Worked for me as well 👍

wilmardo commented 11 months ago

Based on all the positive comments LGTM!

I am still hoping to find some time to make this repo easier to maintain, as soon as someone migrates their testcase is gone. I am for example not running Plex anymore so these changes are hard to test. I have started on a docker compose setup with Jellyfin, Plex and some public domain movies to make this easier but this requires some more attention :)

Again massive thanks for you submission!