Music Metadata questions (not sure if agents or scanners) - missing track artist

I've noticed that the majority of my music tracks are missing their artist.

 

![post-146479-0-42152800-1395849940.png|688x500](upload://wucYMkYqaNjG43JAbJPVJbpH0Ys.png)

 

However, a few of my music tracks do have an artist.

 

![post-146479-0-83507000-1395849940.png|686x499](upload://mNkUA2YiWBdXsWJBmWWegfcqLmc.png)

 

The only correlation I've been able to make so far, is that the tracks with an artist have their "album artist" (band/performer/TPE2) tag set. The funny part is, it's not the "album artist" that is set as the track artist, but the artist field (TPE1).

 

So it's doing the right thing, but only part of the time.

 

I took a look at the code, but I didn't see anything. Can someone point me in the right direction?

 

-Drunken Dwarf

 

When I find odd stuff with my music, it is normally due to wrong or bad metadata in the file itself.  Some of my music for some odd reason has the artist listed under contributing artist (which Plex doesn't pick up) instead of under album artist.  If I manually change the tags, everything works out fine.

When I find odd stuff with my music, it is normally due to wrong or bad metadata in the file itself.  Some of my music for some odd reason has the artist listed under contributing artist (which Plex doesn't pick up) instead of under album artist.  If I manually change the tags, everything works out fine.

If it was just a small selection of my library, I would suspect that. However, the majority of my library is missing artist data.

I'm pretty attentive with my tagging. I have verified that the tracks in questions have the data in the appropriate frame.

-D. Dwarf

Can you provide a screenshot of the details tab from the file properties windows for that file in you first post, "These are Days"?  Also, what is the filename and folder structure you are using?

Can you provide a screenshot of the details tab from the file properties windows for that file in you first post, "These are Days"?  Also, what is the filename and folder structure you are using?

After work I can provide a screen shot.

That particular file is stored in:

  • /storage/media/Music/10,000 Maniacs/MTV Unplugged/01 These Are Days.mp3

/storage/media/Music/ARTIST/ALBUM/TRACK

-D. Dwarf

The filenaming looks right, that's why I'm thinking it has to be metadata related.  You can also try turning off the local media asset agent for music which will then skip the metadata and go with only the folders and filenames.

The filenaming looks right, that's why I'm thinking it has to be metadata related.  You can also try turning off the local media asset agent for music which will then skip the metadata and go with only the folders and filenames.

Local Media Agent doesn't update artist, album, or title. I haven't looked at the LastFM Agent. It might be deleting the track artist.

-D. Dwarf

The LMA is suppose to update those fields from the metadata unless you have it locked.  Or at least mine does.  I had some albums where the artist was showing up as unknown artist even though I had the folder, album name, track all listed correctly.  I checked the metadata and the artist info was missing.  I added the artist name in manually, rescan, and it gets identified correctly.  I go back to the file, take out the artist name again, rescan, and it comes back as unknown artist.

If you data isn't updating, there may be a problem with the scanner.

Also, are you refreshing the webpage after you rescan.  Sometimes, I see a cached copy so it looks like nothing updated until I hit refresh, then all the new info shows up.

The LMA is suppose to update those fields from the metadata unless you have it locked.  Or at least mine does.  I had some albums where the artist was showing up as unknown artist even though I had the folder, album name, track all listed correctly.  I checked the metadata and the artist info was missing.  I added the artist name in manually, rescan, and it gets identified correctly.  I go back to the file, take out the artist name again, rescan, and it comes back as unknown artist.

If you data isn't updating, there may be a problem with the scanner.

Also, are you refreshing the webpage after you rescan.  Sometimes, I see a cached copy so it looks like nothing updated until I hit refresh, then all the new info shows up.

https://github.com/plexinc-agents/LocalMedia.bundle/blob/master/Contents/Code/__init__.py

https://github.com/plexinc-agents/LocalMedia.bundle/blob/master/Contents/Code/audiohelpers.py

I stand corrected.

The artist name, album name, album poster are updated, but only if they aren't already set.

Additionally, it overwrites album originally_available_at and album genre (this part is not standard compliant, I'll start a new thread on this).

There's nothing track specific in the agent, so if there is a change to the track data it's in whatever triggers the agent to run. Do you know what does that?

-D. Dwarf

The metadata is coming from the Plex Scanner script.  If you notice when creating a music library it asks for the scanner and the agent.  From my understanding of agents, the scanner is what gathers the information, and the agent is what fills that information into the database.

The metadata is coming from the Plex Scanner script.  If you notice when creating a music library it asks for the scanner and the agent.  From my understanding of agents, the scanner is what gathers the information, and the agent is what fills that information into the database.

From my reading the scanner searches your library and makes the first attempt at collecting the metadata and identifying the media. The agents then have the opportunity to update any metadata of successfully identified media from other sources (read additional tags, use a web service, etc).

I thought I saw a repository where it saved the information from each step and also the merged information. I'll have to find that again and compare my two reference tracks to see what's different.

https://github.com/plexinc-plugins/Scanners.bundle/blob/master/Contents/Resources/Music/Plex%20Music%20Scanner.py

The music scanner reads the following information from the frames in the mp3 file and only if they aren't populated does it parse the filename and directory structure:  artist (TPE1), album (TALB), title (TIT2), track (TRCK), disc (TPOS), album_artist (TPE2)

All of my mp3s have the first 4 frames populated.

Any idea what system tells the Scanners to scan and Agents to search/update?

I may have to uncomment the print statements (really too bad they don't support the --verbose switch) in the Scanner and see if it's finding the correct information. I'm beginning to think it's not the Scanner or the Agent that's making the mistake.

-D. Dwarf

I believe the metadata is stored here C:\Users\xxx\AppData\Local\Plex Media Server\Metadata.  The search is triggered when you manually rescan.  For local file scanning, I believe it compares the file's modified date and time with the data from the last scan to see if it is different, then it updates, otherwise it skips reading the data.  Not sure what forces an update from the web, could be both get updated with the same trigger.

As requested:

![post-146479-0-79511100-1396067639.png|365x500](upload://5utMGUuJTwqG0128P267eBcd1KO.png)

-D. Dwarf

Yup.  Right there "Album Artist" is blank.  That is what Plex uses to identify the artist when using metadata.  Your's is blank so the artist comes out blank.  That is the same problem I was having, your file has the artist listed under "Contributing Artist".  I don't think Plex uses that.  Manually add 10,000 Maniacs to "Album Artist" and refresh.  I will bet it comes out correct this time.

Yup.  Right there "Album Artist" is blank.  That is what Plex uses to identify the artist when using metadata.  Your's is blank so the artist comes out blank.  That is the same problem I was having, your file has the artist listed under "Contributing Artist".  I don't think Plex uses that.  Manually add 10,000 Maniacs to "Album Artist" and refresh.  I will bet it comes out correct this time.

While true, that's wrong.

"Contributing Artist" is TPE1 - AKA Artist.

Plex doesn't use "Album Artist" (TPE2) for the track artist, even if it is set. The track artist name comes from the frame TPE1. I'm not sure how "Album Artist" is used. I assume it's used to create the high level hierarchy.

Here's an example:

Music\Adam Ant\Antics in the Forbidden Zone\01. Zerox.mp3

![post-146479-0-72033400-1396075181.png|365x500](upload://umbjHSvkrGVJ9bhRp5x4cfv6nrT.png)

Music\Adam Ant\Antics in the Forbidden Zone\21. Vive Le Rock.mp3

![post-146479-0-44680100-1396075181.png|365x500](upload://2mJDPuJcSp5CvMOf4yK9YDIXArj.png)

The album appears once in Plex under the artist "Adam Ant". However, you'll see the track artist is "Adam And The Ants".

![post-146479-0-32309000-1396074947.png|683x500](upload://6Hf1biYC9f9IKckTn6uBlMuVjRh.png)

So it is definitely use the Contributing Artist data to populate the track artist field. My question is why does it only do that when the Album Artist is populated?

-D. Dwarf

I'm pretty confident my issue is not with the scanner. I'm still trying to determine if I can fix it with an agent. It's quite likely there's a statement in the Framework like:

if album_artist is not None: track_artist = metadata.artist

That I'm not going to be able to work around.

-D. Dwarf

I did a bunch of testing with various combinations of tags and trying to read through the code, here are my findings.

1 - Plex uses 'Contributing Artist' for the Artist listed in the root of the music UI

2 - If 'Album Artist' (TPE2) exists, override 1 for the Artist

3 - If neither exists, check if 'Title' in in the format 'artist - title' and use newly found artist

4 - If no title, use the filename for the title and recheck 3

5 - If 4 doesn't work, check if folder is in the format "artist - album" and use newly found artist

6 - If the above fails, use "[Unknown Artist]"

7 - If within a folder, >90% of files have the same Artist (the final one used), apply this to the files with [Unknown Artist] in that folder (I didn't test this one, but it is in the code)

The above Artist is what will be filled into the Artist field when you edit at the root.

Once the Artist is identified, the files are grouped into albums, which come from either the Album tag or if that doesn't exist check folder for "Artist - Album" otherwise "[Unknown album]".

Within the Album, songs are arranged into tracks.  Each track is a file.

The track # comes from either the "track" tag or the filename if it is in "xx - Title" format, otherwise blank.

The track name comes from either the "title" tag or the filename from above, otherwise blank.

The artist shown when you hit edit is from the "Contributing Artist" tag, but only if "Album Artist" exists.  No other way I could find to get this field to show.  If there isn't a "Contributing Artist" but there is "Album Artist", it uses that instead.

Seams like the coding is using the tags backwords.  It should use the "Contributing Artist" as the root level, and "Album Artist" within each album.  When I have time to mess around with this I'm going to change the code and reverse this to see if it works out better.

1 last thing I noticed is that nowhere does it scan for the Artist / Album structure.  It does checks for "Artist - Album" and works well when there are no tags.

I did a bunch of testing with various combinations of tags and trying to read through the code, here are my findings.

1 - Plex uses 'Contributing Artist' for the Artist listed in the root of the music UI

2 - If 'Album Artist' (TPE2) exists, override 1 for the Artist

3 - If neither exists, check if 'Title' in in the format 'artist - title' and use newly found artist

4 - If no title, use the filename for the title and recheck 3

5 - If 4 doesn't work, check if folder is in the format "artist - album" and use newly found artist

6 - If the above fails, use "[Unknown Artist]"

7 - If within a folder, >90% of files have the same Artist (the final one used), apply this to the files with [Unknown Artist] in that folder (I didn't test this one, but it is in the code)

The above Artist is what will be filled into the Artist field when you edit at the root.

Once the Artist is identified, the files are grouped into albums, which come from either the Album tag or if that doesn't exist check folder for "Artist - Album" otherwise "[Unknown album]".

Within the Album, songs are arranged into tracks.  Each track is a file.

The track # comes from either the "track" tag or the filename if it is in "xx - Title" format, otherwise blank.

The track name comes from either the "title" tag or the filename from above, otherwise blank.

The artist shown when you hit edit is from the "Contributing Artist" tag, but only if "Album Artist" exists.  No other way I could find to get this field to show.  If there isn't a "Contributing Artist" but there is "Album Artist", it uses that instead.

Seams like the coding is using the tags backwords.  It should use the "Contributing Artist" as the root level, and "Album Artist" within each album.  When I have time to mess around with this I'm going to change the code and reverse this to see if it works out better.

1 last thing I noticed is that nowhere does it scan for the Artist / Album structure.  It does checks for "Artist - Album" and works well when there are no tags.

I concur with your findings.

The red text is the issue I'm annoyed with.

I suspect the green text is handled at a higher level than the scanner (framework possibly). In my case the contributing artist (Adam And The Ants) doesn't show up as an artist in Plex, only the album artist (Adam Ant) does.

The LocalMedia agent doesn't populate track information. Tonight I'm going to modify it to do that and see if I can impact the behavior.

-D. Dwarf

The LocalMedia agent doesn't populate track information. Tonight I'm going to modify it to do that and see if I can impact the behavior.

This doesn't impact anything. The metadata shows up in the XML files, but not on the UI.

I'm pretty confident that the issue highlighted in red is not in a scanner or agent, but in code only the devs have access to. We'll need to summon a dev to answer the question.

Will repeating elan's name 3 to 5 times summon him (as with Beetlejuice or Candyman)?

-D. Dwarf

If we can't get a developers input, I think I can cheat and modify the Scanner to set the album_artist to the artist when album_artist is None. That should work around the issue.

-D. Dwarf