Removing featured artists from renaming : an %albumartist% problem

Tags: #<Tag:0x00007fe318286c18> #<Tag:0x00007fe3182869c0> #<Tag:0x00007fe318286628>

So with a long bank holiday weekend I took the opportunity to do a clean install on my PC and thought this would be a good time to tidy up media too (file names, structire and metadata) so I have only just discovered MB Picard and though it seems wonderful, it’s not coming naturally:

I was aiming to sort out the metadata so that my media server can find it all better, but also to sort out the directory structuring to something along the lines of:

Z:\Artist\Album\Artist - Album -

I’ve managed what seems like, for my ability at least, a tidy enough solution to my needs:

$replace($if($eq($left(%albumartist%,4),The ),%albumartistsort%,%albumartist%)/$if($and($eq(%compilation%,1),($eq(%albumartist%,Various Artists)),$if(%album%,%album%,Songs)/%artist% - %title%,$if(%album%,%album%,No Album)/%artist% - $if(%album%,%album% - ,)%title%),:,-)

I’m struggling with feat artists (which I sense a lot of people are):
I used %albumartist% and %albumartistsort% as the album folder hoping this would get me just the main artist.
I used %artist% in the filename as I’d quite like this to be the only place to see “feat”.
I’ve encountered a couple so far that despite being on the same album clearly have a different %albumartist% value for the featured artist tracks.

I was hoping for:

Z:\ArtistX\AlbumZ\ArtistX feat ArtistY - album Z - Trackname.mp3

rather than

Z:\ArtistX feat ArtistY\AlbumZ\

and I wish to leave the featured artist out of the main artist folder and album folder titles.

Is there a way to automate the removal of the “feat xyz” from the %albumartist% and %albumartistsort% strings I’m using? Would I achieve this with rename code or in the main Picard window somewhere?
Ideally I want to maximise the automation and avoid hand labelling tags (one way I can see to fix it) just to get the folders right and the idea of fixing the folders manually seems even worse. (It may only be few but its occurred several times on the small sample of songs ive run through Picard so far and I’m keen to nip it in the bud early). I did see something about plugins but they didn’t sound like they do this and something else about using $rreplace but I couldn’t get my head round how it worked.

First of all, I’m assuming the ( just before the $eq(%albumartist%,Various Artists) is miscopied – I’d think Picard would be giving a rather obvious error if it’s in the actual script. Second, whitespace and line breaks are tricky in Picard’s script entry boxes, but the file naming one seems a bit more forgiving, and we can make that block of clearer by taking advantage of that:

    $if($eq($left(%albumartist%,4),The ),%albumartistsort%,%albumartist%)/
    $if($and($eq(%compilation%,1),$eq(%albumartist%,Various Artists)),
        $if(%album%,%album%,Songs)/%artist% - %title%,
        $if(%album%,%album%,No Album)/%artist% - $if(%album%,%album% - ,)%title%

I’m not immediately seeing anything that would put featured artists in that level of the hierarchy, so mind giving us an example of a song that’s doing that? And just to be sure, you are using the scan/lookup functions to match the tracks to ones on the database, right? Picard won’t fix a malformed album artist field if it doesn’t know what to fix it to.

One last note on your script while I’m here: you may want to look at the $if2(...) function, which uses the first non-empty argument. Your $if(%album%,%album%,Songs or No Album) calls do the same thing, and if you find that clearer to read then feel free to leave them as they are, but if you ever wanted to expand beyond two potential values, $if2(%album%,%_othervariable%,No Album) very quickly becomes much more compact.

1 Like

I take your point about tidying it up (and would love to get it down to a shorter string) using $if2, but for now it’s doing the job. I guess the if statements I used were just what I created as a mental flowchart and I didn’t bother streamlining my thoughts either. My aim for now is just to make my digital music collection appear in Plex without looking like it’s been put through a blender! As my dad once told me “if it isn’t broken, don’t try to fix it”.

Looking at the script, there is no “(” where you suggest and Picard seems quite content. (With the way I’ve nested ifs and ands, I don’t think it needs one as it follows the comma in the and statement.) I’m always prepared to be wrong though, so I tried adding the “(” and it threw up an error so I took it back out. See pictures.

To answer your other question, yes I have been using lookup and scan but I do think you are on to something with the general theme of Picard only being as good as the tags in the right side of the window…

Some of the albums have been dragged (in various states of completeness) from a failing NAS and then probably infilled to make them “complete” where it has been noticed to be missing). Others my wife pooled in from her old laptop/hard drive after we started living together…

With some of the very messy files I’ve been leaning on scan quite a lot. How else do you sort something with meta data like: artist:artist and album:aLbum, track:track01when of course they are conveniently filenamed as 01.mp3, 02.mp3… ? (god only knows how they were ripped).

As an example, there are quite a few “Now That’s What I Call Music” compilations with badly mashed meta data and the song LMFAO - party rock anthem may be a good example. With poor meta data I used scan. Scan fingerprints it as a single release rather than attributing to a “now” album. (I get that I need to sort them manually back to the right place but some are in folders such as (Now 70-79) which doesn’t help.

I think Picard has fingerprint matched them as singles, attributes them to artist X feat. Y and then the ‰albumartist does not come as various but as X feat. Y. (as it should for that single).

I’m think I’m going to let it just tag them that way for now and then I’ll re-Picard (is that a word) all the incomplete/silver “now” albums separately. It should be easy enough to find the missing tracks as they will at least have the correct artist and title in the song name.

And without the (… As I can only put 1 image per post…

Yeah, the second is what I was imagining it would (and should) look like in Picard – I was just being careful because the script in your original post had a ( where I couldn’t see any reason to have it. And Picard matching them to single releases would certainly explain what’s happening with the album artist. Doesn’t necessarily help in this case (I don’t envy you for having to deal with all that), but if you have an album together in one folder without anything else mixed in and it’s one of the ones with slightly better metadata already, you might try hitting “Cluster” and then “Lookup” rather than “Scan” – the second just tries to match it with something based on the sound, but the first actually takes the existing data and number of tracks into account, and will generally do a better job of keeping the album together.

1 Like

I know this thread is over a year old but I just really wanted to thank you because I looked for a few hours and this is the first script I found that actually resolved the featured artists going into their own different folders! Thanks a million!!!


This is pretty embarrassing but I honestly can’t figure out how to change the code so that it is EXACTLY the same but there is no album name in the title. I know that this is probably the most simple thing ever but I just tried many different things and I was able to get the album name out of the title but then the folders went away for album so could you PLEASE show me the script that will be exactly the same but no album in the title.

Thank you!!