I have an extensive audio-drama library in a standard library and I’m in the middle of prettifying it. All tracks are perfectly tagged and show up in Plex nicely. Since I can’t use online metadata because it wouldn’t recognize the artist or albums I’m stuck doing things manually (creating Artist covers / descriptions…)
One thing I’d like to automate is to fill out the Album review field for each album. Is there a scraper which can read from a file or a tag which can easily be modified to achieve what I’m looking for or is there a special m4a/id3 Tag which should hold that information so it gets scraped automatically using the plex scraper.
All my album folders contain a plain text file (summary.txt) und furthermore all files of an album have the lyrics tag filled with the review information.
I’ve recently been doing a few tests on what metadata it is possible to add via agents, so may be able to help you.
Here’s a quick proof of concept metadata agent. If you have a little programming knowledge then you can adapt it as needed. I used the simplest case of adding the entire contents of summary.txt to the artist biography or album review depending on where the file is saved, if you need tag support then you could add a library like tinytag to read the files.
Thank you so much @contrary_cat. I’ll throw it tomorrow at a test library. If it works I’m more than happy.
I have no experience with python - only a little bash scripting. My first baby steps were a few hours ago when I tried reading the lyrics & the long description tag with mutagen and print it to the command line - which to my surprise worked. But where to go from there is still a mystery to me…
Once again thank you very much @contrary_cat. This works beautifully. 4239 albums now with reviews (minus a few where I had typos in the filename) . You can’t imagine how grateful I am !!!
And of course thank you @OttoKerner for replying in the first place
Just happened to stumble upon this thread and would love to know how this works as I have 1000’s of albums which would love to have the reviews added so I don’t have to do them one by one like I have been doing. Does this just go into the plug-in folder within Plex. Any help would be appreciated.
Exactly. The bundle file goes in the Plug-ins folder.
(e.g. location on ubuntu 18.04)
After copying make sure that the bundle has the same owner as the user Plex is running under. I’m not really sure if a restart of Plex Server is required but after restarting the Plex Server you should be able to activate the Agent.
After activating you should be able to refresh the metadata of an album and the contents of the summary.txt will be shown in the review field.
Thanks for the response I have put it in the plug-ins folder i am using windows 10 I presume this will still work work with that??
The agent is showing up in the list of agents and I have ticked it, but when refreshed the metadata for the album the review field still stays blank.
The only bit that has thrown me is the following sentence:
After copying make sure that the bundle has the same owner as the user Plex is running under. I not sure if been a bit thick here but not sure how to check this??
This is for Linux platforms mainly. You can disregard this, if you don’t run Plex as a Windows System Service (which is not the default and requires additional software and effort).
Thanks for the response, so I guess this will not work if using windows 10 and Plex Web in that case as I have done everything else but still not showing up the album review.
It is working for me here on Windows 10.
Make sure that the agent is activated under
Settings - Agents - Albums - Plex Premium Music / last.fm / Personal
The file must be named summary.txt
all lower case! (If I read the code correctly, casing is important.)
The file must use the UTF-8 text encoding.
Windows/ANSI encoding won’t work as soon as there is only one character in the text which is not contained in the default English 8bit character table.
You can use the ‘Save as…’ command in notepad.exe to change the text encoding.
Bingo got it working now the bit that that I did not know was about the UTF-8 encoding, I was using the standing windows/ANSI encoding so thus was not showing up at all.
Thank you very much for the help was very much appreciated as been looking for something like this for ages for Plex.
@contrary_cat I have now confirmed that the text file must use the UTF-8 text encoding. If you use ANSI on Windows, import will fail.
You might wanna add a note to your package.
Is it possible to use this metadata agent as a template in order to create a new agent that reads fields such as:
Album Rating
Play Count
Play Date UTC
etc from a specified “iTunes Library.xml” file that can be generated from an iTunes Export operation? I’m trying to migrate a large library with a lot of history from an old iTunes media server to a new system. It’s not convenient or even really practical to recreate the iTunes Library so that Plex can try to import these data items initially. A tool that could read the export xml file asynchronously and update the library once would be quite useful.
If it’s possible and I can be given a little direction, I’m ready to try modifying what @contrary_cat has so generously provided for a slightly different problem.
The feature that is provided is focused on supporting an upgrade to a Plex Server that is running on the same machine as the original iTunes installation. At least that is how it is advertised in the online documentation. In my specific case, and I imagine there are many variations of this, my iTunes installation is on an old Mac Mini. It is not practical to try to run Plex on this machine, especially as I want my Plex installation to also support my video and photo services going forward. So my origin is iTunes running on old slow machine A but my destination is Plex running on fast machine B. In this case, I do not believe the existing functionality is useful.
I did try to “fake out” Plex by first copying the iTunes Music Folder database to a drive that would be accessible to the new Plex server running on fast machine B. I also carried over the iTunes Library.xml file and then I asked my new Plex installation to import. Track ratings and play counts did not carry over. Some information affecting “Recently Added…” was picked up, but it was not clear to me whether this was coming from the iTunes xml file or if it were coming from the file modification/creation dates provided by the filesystem.
I believe that if you could invest in a feature to read the iTunes Library.xml file, extract the meta data, and then attempt to apply it to an existing Plex Music database, overwriting data already in the Plex mySQL database, this would be a versatile and popular feature among the hopefully many existing iTunes based users who still value their local music libraries and take Apple’s recent decisions to finally jump ship to Plex.
I have been learning more about how Plex works and trying to understand the database structure to see if I can write an external script to do the work, but I’d much rather help you define the feature and test it!