Jump to content

Importing Plex (movie) metadata


Sludge Vohaul

Recommended Posts

Sludge Vohaul

As I am probably not the first one who wants to move away from Plex to Emby, the question how to move configured metatada from one DB to the other one should not be too unusual. Unfortunately I haven't found any solution so far, so I guess there is none (correct me, if I am wrong, though).

 

In this case I'd give it a try to implement some sort of a PlexExportEmbyImport-tool.

I think there are two main ways how to implement this:

1. A server plugin

Wants probably to be written in csharp but involves some sort of a HTML-UI for configuration and user interaction, as well as the plugin glue-code. This is probably not too complex, but still new to me.

Seems cool, but as a user will probably use it only once, it's somehow an overkill.

 

2. Standalone tool

Could be written in Python/Perl/Brainfuck/whatever but should be in csharp, too, I think. I'd prefer simple CLI-ouput, and configuration through a configuration file/CLI parameters. Simple and straightforward. 

Might get less acceptance than a plugin, as one cannot click a "Import metadata from Plex"-button in the UI.

 

What do you think would be the better way to go?

 

 

For an initial release I'd try to handle my (simple) world, which consists of movies having custom titles, custom sort titles and belong to some collections. Maybe the selected movie poster and background image, too.

 

Regarding the workflow, the tool would expect the movies to be already imported to Emby, and then read the metadata through the Plex API and update Emby through it's API. Collections would be created as appropriate.

It would only affect the main movie, as "data structures" for movie extras are currently not really compatible.

 

 

 

Link to comment
Share on other sites

Awesome ! If this is a one-time migration i would just do a separate tool. You probably don't need to go through the process of building it into an emby plugin.

Link to comment
Share on other sites

Sludge Vohaul

maybe the whole process is not that good.

A few minutes ago I stumbled upon nfo files here. Never heard of this sort of nfo files before, but the way to go is probably to generate them from the plex metadata, and let Emby do all the importing.

The drawback is that it would require write access to the movie files partition/dataset in order to copy the files to the appropriate movie folders.

Link to comment
Share on other sites

PenkethBoy

its been a while with plex but does it save nfo/xml files with the data you are after - sort title etc

 

if so the process would be to import your library into emby - wait for the scan to complete

 

copy info from one nfo to the other

 

pull the collection data out of plex (is it stored in a defined folder like emby?) create the eml files for emby and save them in the collections folder - on rescan they will get picked up as the file paths are the same to the source movie files - if not just correct the path during conversion

 

If this process works all you need is a app to convert nfo's and xml files - which is what i am spec'g out at the moment

Link to comment
Share on other sites

Sludge Vohaul

its been a while with plex but does it save nfo/xml files with the data you are after - sort title etc

 

if so the process would be to import your library into emby - wait for the scan to complete

I haven't found any configuration nor action button for "storing metadata on disk". Forums also say it's not possible with Plex. Maybe through the API, but I haven't looked at it yet.

 

If this process works all you need is a app to convert nfo's and xml files - which is what i am spec'g out at the moment

Maybe you could ask the Emby devs for the XSD validation schema they use - I could imagine they do validate the XML files before processing them...
Link to comment
Share on other sites

PenkethBoy

Ah yes one of the things that caused me to drop it as an option for my media - i remember now

 

Ok a bit more digging will be required then - yes the api might give up the data not looked - have added it to my list :)

 

if there is a schema great but the xml in the nfo is very basic so not a major issue to sort that out :)

 

nothing compared to a multi megabyte - hydraulic modelling input file which can be free format along with geographic info as well

Link to comment
Share on other sites

Sludge Vohaul

along with geographic info as well

This is a nice topic :)

I've spent quite a lot time on implementing the db schema for a usable photo library, but dropped the whole thing as I simply do not have enough time to write the client code. The location metadata was also a point. You may have been on vacation and come back with 500+ photos, which you want to import into something location aware. You'd then query 500 times some web service to get the location from the longitude/latitude photo metadata.

I mean a few (more) years ago the Google search web service was free of charge for 10 or so searches per hour, what if there was an Emby plugin to query the Google location service? Do you know whether it is free of charge?

 

Regarding the XSD schema it must be in the Emby sources or at least an URI to it. Should not be a big deal to find it, if there's one...

Link to comment
Share on other sites

PenkethBoy

only 500 - rofl - can you educate my lot on that :)

 

 

the math for lat/long is not difficult to covert if necessary - depends what name/location/and associated data you want to add to the photo data - exif? or emby? or both?

 

big G is not the only source of this sort of thing

 

yes if its there... :)

Link to comment
Share on other sites

Sludge Vohaul

the math for lat/long is not difficult to covert if necessary - depends what name/location/and associated data you want to add to the photo data - exif? or emby? or both?

Um, no. the photos have their Exif metadata, Lat/Long is part of them. I don't thing you can mathematically compute the address "USA, NY, Broadway 123" from them. It's a sort of mapping which cannot be done locally (as one simply does not have the data).

Emby stores Exif metadata in the DB as an JSON string in a photo's record. There is no "address" field.

So with the currently available data you cannot do something like SELECT COUNT(photoid), city FROM some_table GROUP BY city, as the location-data simply is not present. This data would have to be queried during import of a photo.

 

 

big G is not the only source of this sort of thing

I just played a little bit with it, but Google returned the most precise results (I haven't tried Apple though). Edited by Sludge Vohaul
  • Like 1
Link to comment
Share on other sites

PenkethBoy

http://www.latlong.net/Show-Latitude-Longitude.html

 

just put in a random made up lat/long 52.515 0.236 = Wisbech PE14 9RH, UK 

 

you could pre process the files and add it as TAG but i dont think the emby search works with tags :( - last time i tried

 

but there are several other places to put the info - overview,website or append to title - website might be good to add the url to google maps/street view etc

 

have to test if you add data to genre or studios as this might mess up a lot of other stuff :)

Link to comment
Share on other sites

Sludge Vohaul

http://www.latlong.net/Show-Latitude-Longitude.html

 

just put in a random made up lat/long 52.515 0.236 = Wisbech PE14 9RH, UK 

 

you could pre process the files and add it as TAG but i dont think the emby search works with tags :( - last time i tried

 

but there are several other places to put the info - overview,website or append to title - website might be good to add the url to google maps/street view etc

 

have to test if you add data to genre or studios as this might mess up a lot of other stuff :)

I think it is a dead end to try to work around missing functionality (which is, regarding the photo libraries in Plex and Emby too, IMO rather limited). There is quite a lot of useful Exif data stored during import, but it's never used. If this doesn't change in the future people will stop using it. It's not state of the art anymore to have photos sorted by year and month.

I want to see the photos from my last trip to London, and I also want a calendar view of the year, with the day tiles colored from black to red depending on how many photos have been taken that day (sort of a heat map). I also would like to have some mass tagging functionality, or configurable dynamic collections (like all photos taken in London, or all photos taken within the same seconds (to get rid of duplicates)). Most of the data is already there -it's mostly the UI which needs new functionality.

 

--

sv

  • Like 1
Link to comment
Share on other sites

we actually record a decent amount of metadata from photos, we just don't do much with it. as always please make sure to file feature requests for what you think is missing. thanks.

Link to comment
Share on other sites

PenkethBoy

@sludge i will leave you to file the FR as you have some good ideas that i would like to see as well

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...