the albums in my music library are tagged with multiple genres in the mp3 tag, separated with ";".
For example: An album is tagged with "Rock; Stoner Rock; Psychedelic Rock"
Every player - especially Media Monkey - I used so far accepts that and displays the genres correct.
Media Monkey displays the following in the genres list:
Rock
Stoner Rock
Psychedelic Rock
Plex however sees that as one genre and therefore shows "Rock; Stoner Rock; Psychedelic Rock" in the filter option of genre of my music library. This is obviously not what I want.
I tried to find the code where the magic happens and found something in the audiohelpers.py of the LocalMedia.bundle.
The issue you're going to run into with Plex fixing this is the ";" is not a standard separator supported by the ID3 specification, so it's unlikely Plex will adopt support for it natively.
# Genres
try:
genres = tags.getall('TCON')
for genre in genres:
for g1 in genre.genres:
genre_list = g1.split(';')
for g in genre_list:
if g not in metadata.genres: metadata.genres.add(g)
except:
Log("Genre Exception")
pass
You'll need to made a copy of the agent, otherwise your change will get automatically overwritten.
Thanks for the code. Did you make the change in audiohelper.py of LocalMedia.bundle and was is in your Plex installation directory or the one in your %localappdata%.
I made the changes in both directories, but with no effect on the agent, i.e. no genre showing at all. Did you rename the agent and is it visible in the settings for the agents? In mine it's not.
I made a copy of the LocalMedia.bundle directory and named it MyLocalMedia.bundle. Then I searched and replaced LocalMedia with MyLocalMedia in that new directory. Finally, I modified audiohelpers.py.
Then you need to go into the agents settings on the server and uncheck Local Media Assets and check My Local Media Assets. You may need to restart the server, I don't remember.
I'm running on Linux, so my paths will be different than yours.
I've just stumbled across this thread a few days after posting the same issue in another Plex forum (where it has so far received precisely zero views).
Do I understand that the fix proposed by D.Dwarf seems to work on Linux, but not on Windows? If so, that is very disappointing and annoying. It's annoying that MediaBrowser 3, Media Monkey, Windows Media Player and even the Windows File Explorer can all deal with multiple values in the TCON tag, but that Plex cannot.
Also, I thought that the separation character in the ID3v2 spec might be the NULL character - it just gets shown as a semicolon character in the UI?
I don't know if it'll work in Windows or not. It should.
It's been a while since I looked into this, but I think what has happened is that many clients have started using ';' to separate the fields instead of the null character to make it more human readable/editable. Then strict clients don't display it properly.
tags.getall('TCON') should return an array of genres. If it doesn't, it's because your client has not written them according to the specification. If was more motivated, I would make that character configurable so people that use '\' or '/' wouldn't be left out.
I made a copy of the LocalMedia.bundle directory and named it MyLocalMedia.bundle. Then I searched and replaced LocalMedia with MyLocalMedia in that new directory. Finally, I modified audiohelpers.py.
Then you need to go into the agents settings on the server and uncheck Local Media Assets and check My Local Media Assets. You may need to restart the server, I don't remember.
I'm running on Linux, so my paths will be different than yours.
-D. Dwarf
Well, the topic of multiple genre tags pops up for me as well. Im on a windows plex media server and got many mp3s tagged with musicbrainz picard.
Your solution did not work for me so far, maybe you could elaborate? I made the copy of the MyMedia.bundle (folder) and edited "audiohelpers.py".
But what do you mean by "replaced LocalMedia with MyLocalMedia" - the text string within other files or just in filenames?
MyMedia did not show up in the server settings after a restart, yet :(
If i just edit the original audiohelpers.py, it will get overwritten with every update, right?
btw: my audiohelpers.py did look a bit more complicated..
# Genres
try:
genres = tags.get('TCON')
if genres is not None and len(genres.text) > 0:
metadata.genres.clear()
for genre in genres.text:
for sub_genre in genre.split('/'):
metadata.genres.add(sub_genre.strip())
except Exception, e:
Log('Exception reading TCON (genre): ' + str(e))
Thanks in advance.
EDIT:
As i pasted my audiohelpers.py i realized the "genre.split('/'):" part. After changing to ";" it seems to work! ;)
I can edit the audiohelpers.py to get it to work but it gets overwritten / resetted rather often.
So: how do i create my own mediascanner that doesnt get overwritten?
I tried to copy and rename the whole LocalMedia.bundle but it wont show up in settings :(
You don't need to. They've updated the LocalMedia.bundle to handle '/' and ';' and 'nul'.
If you really want to, follow the instructions for creating a new bundle and copy the contents of LocalMedia.bundle into it. Then make your changes in the new bundle.
Well, not quite. Although the Plex Server can handle multiple genres in your tags, it would appear that at least some of the clients studiously ignore this. See