New music Metadata agent leaves blank Artist field when upgrading premium music library

Server Version#: Plex Media Server 1.18.1.1973 QNAP AMD64
Player Version#: Plex Web 4.10.1

As many other Plex Pass subscribers, I had my “Premium” music library automatically upgraded to the new system. I then tried to upgrade an artist in my music library refreshing the metadata and I found a problem: only the tracks whose Artist field was different from the Album Artist field were populated. All the tracks whose Artist field was different from the Album Artist one were left empty.

An example:
Inked-Shared-Screenshot1-LI
Inked-Shared-Screenshot2-LI
Inked-Shared-Screenshot3-LI

All the metadata are present in the mp3 file:
Shared-Screenshot4
image uploader

Refreshing the metadata lead to nothing, as doing the “Plex Dance” removing and adding back the albums… Is there anything we can do about this?

1 Like

I’m also experiencing this issue. Most of the tracks have no artist and some have. When I perform a metadata scan, it fills a few artists metadata and stops after about 20-30 artists.

1 Like

It’s not your fault. The agent was coded that way:

    if str(track_artist) != str(album_artist) and album_artist is not None:
      return track_artist
    return None

means that the track artist is only returned when it’s different from the album artist (and the album artist is not empty).

If Plex doesn’t want to change this behaviour, you can change the block of code above to

    return track_artist

to always return track artist. There are 4 of them in this file. It probably works but don’t quote me on this.

I recommend against manually editing the file if you are not sure what you are doing and the implications.

1 Like

That a really weird way to handle metadata if you ask me. I don’t see why anyone would want artist to be empty if album artist is filled in and different. The tags are present, the metadata is present and the artist metadata for the client is fetched anyway. What possible use could it be to leave the artist field empty ? This isn’t a good solution if you ask me, or at least not a pretty one as half of my library seems “untagged” and sorting is terrible. Sorting on artist I can only sort on a small amount of records and sorting on album artist I have 50 songs from a wide ranges of genres under ‘Various Artists’. What is the clue of this way of handling the artist tag ?

1 Like

I think you misunderstood me.

  • Artist is filled in if album artist is filled in and different.
  • Artist is not filled in if album artist is identical or empty.

With my suggested change, artist will always be filled if it’s found.

¯\_(ツ)_/¯ beats me why Plex wants to be “smart” like this.

Thanks for the explanation @ squaresmile: since the system was clearly omitting the track artist only when the latter was the main artist itself, I feared this was a planned behavior… But as stated by Havermans_Stef this isn’t an elegant solution and it may have some drawbacks.

If Plex really want to clean the interface omitting what is considered a “redundant information”, Plex should just hide this field from the album page with a script: I think that leaving it blank is really a bad practice…

  1. This behavior is inconsistent when a comma is found in the Artist field, for example:
    Album: Friday Night in San Francisco
    Release by Paco de Lucía, Al Di Meola & John McLaughlin
    Obviously all the songs of this collaborative album should be credited (and searchable) using any of the following keywords: de Lucía, Di Meola and McLaughlin.
    Now, that’s the metadata gathered by the new agent:
    Shared-Screenshot1
    Shared-Screenshot2
    Results: since the artist field is left empty, all the songs of this album are only linked to de Lucía.
    I know that at the moment Plex doesn’t index well collaborative albums crediting them only to the first artist (and that is already a well-known problem, see: New music Metadata agent doesn't like compilation albums or albums by multiple artists), but with this agent not only this album is credited to only one artist (de Lucía): it credits all the songs in it to this artist alone while it should show:
    Inked-Shared-Screenshot3-LI

  2. This behavior leads to different search results from the one obtained with the old agent:
    Album: 25
    Release group by a‐ha
    When you perform a search using A-ah as a keyword all the relevant artists and albums are shown as expected but, since the Artist field is blank for all the tracks… not a single song registered by the A-ha is shown:
    3
    4
    Whit the old agent:
    2

  3. Are we sure that all the third-party services relying on Plex metadata (e.g.: Sonos) will work as expected?

Are we sure this behavior is what we want? Isn’t it simpler to just fill the Artist field and then hide it from the interface (or better, create an option to let every users choose what they want to display)?

1 Like

If there’s positive side, any album that is not found on MusicBrainz, will still show the track artist, even if the album artist and track artist are the same in the embedded metadata. :upside_down_face:

Plex has decided that the name of the artist for tracks is not important in most cases. It makes the the display for the track titles look weird (can’t think of a better term) when the only displayed artist is one that differs from the album artist. Looks like there is missing information, for most tracks.

It’s been stated in quite a few threads that all metadata is entered and saved on the individual tracks, and Plex is ignoring that fact. It’s impossible to create a playlist for a particular artist that includes all the tracks on every album (Including Various Artists albums) when the track artist isn’t even an option to define.

Yes, that’s another drawback…

I think that’s the case, as the Artist field is fetched to Sonos… It’s just not visible through the interface, but the fact that it looks like empty in the edit field is misleading.

This interface gives the idea that there are missing information and looks buggy (wrong/incomplete metadata import) until you realize that only a specific information is omitted.

Don’t suppose there’s a good source for ‘understanding what we’re doing’ in this case? I’m not familiar with the guts of Plex enough to know what implications I’d be incurring, but I’m a fair hand coding. I’d be interested to know if anyone has good resources to help get a jumpstart here, because this topic annoys me to no end and I’d be very happy to fix it on my own if possible.

thanks, somehow I missed this before.

I will check this out later, it might solve a majority of my problems with the new plex scanner (lack of track artists).

Just poke around the plugins folder. If you already know programming or Python, you should be fine. I just don’t really want to support from the basics or guarantee anything.

1 Like

My only issue after modifying the python is having it picked up or recompiled - doesn’t seem to take the changes on a simple server reload, so I suspect I missing a step somewhere. Online sources seem to assume you know how to have the modified scripts picked up once modified. I’ll keep poking around - I’d love to go script diving beyond this.

It should pick up the changes after a server restart. I’m quite sure PMS also already reloads the plugins after editing.

Chances are the modified lines are not being run. Make sure the agents/scanners are used. Make sure “Prefer local metadata” is turned on. You probably need to do the Plex Dance on the music files if the modified code is in the scanner.

Use Log() to write to the log file: https://github.com/squaresmile/Plex-Plug-Ins/blob/master/LocalMedia.bundle/Contents/Code/audiohelpers.py#L19

is there a good way to keep this edit intact across plex updates ?

Thanks for the nod - server restart did indeed pick up the changes, and I was using Log() to see what functionality was being hit. Once it picked up the changes, I’m finding the lines I need to pay attention to. Oddly, even forcing the return on track_artist in that function doesn’t seem to work as I’d expect, though the function does pick the correct result to pass back. I’m wondering if that choice is being overwritten elsewhere beyond audiohelpers.py despite prefer local being used.

I’ll keep poking at this as I have more time, but appreciate the initial lead and help!

Hmm, just a simple return works with mine: https://i.imgur.com/KtHM0Ai.png My library is the basic one with “Prefer local metadata checked”.

I suppose make sure you edit all or the correct functions for the different helper classes.

Here is what I changed OGGAudioHelper class:

  def get_track_artist(self):
    try:
      album_artist = self.get_artist_title()
      track_artist = self.tags.get('artist')[0]
#      if str(track_artist) != str(album_artist) and album_artist is not None:
#        return track_artist
      return track_artist
    except:
      raise
      return None
1 Like

Last time, I used a patch file that I applied after a PMS update.

Also keep in mind that the plug ins folder name changes because of the git tag and apt/dnf might not remove the old edited files cleanly.

1 Like

I restored from a backup and re-modified all the entries for the track_artist return and, at first, it wasn’t working. What I did notice was that it came in with no artist at first, but even with a one-album Music library it took a while to refresh. Once the refresh happened - I’m guessing at the end of the metadata process - the artists did show up after the file dancing. Not sure why the refresh was taking so long on a bare bones install, but I’m going to test a few more filetypes and hopefully call it working.

Glad I took a fresh dive this morning, this will make my Plex life much happier. Thank you!

what I ended up doing is loading audiohelpers.py and doing a search replace on

replacing != str(album_artist) and album_artist with nothing, essentially deleting that portion of the string.

this way there is still some validation/error checking.

I think there were 3 or 4 sections.

then a rescan, followed by a refresh all metadata on root music library, and it seems to be working.

The latest beta PMS now seems to have fixed the ‘no track artist’ problem for various artists (ie, Album Artist = blank) compilations!

For some bizarre reason half of my V/A albums now have “The Muppets“ as album artist, but at least the track artists are correct. One step forward, one step back.

Next hope: correct handling of genre and year by track (so multi-genre and/or retrospective compilations are usable) and it’s starting to look like a workable music library.

3 Likes