Help for adjusting renaming script

I downloaded the file from github, but I do not see a section / line that mentiongs _artists_album_primary_tags when I look at it in notepad.

Also, the part …
$set(album_artist_genre,$if2($getmulti(%_artists_album_primary_tags%,0),unknown))

do I need to add this somewhere or is it in the update file?

The file from GitHub is a plugin, not a script. You will have to install it in the plugins section of the Picard options. The line:

destination_metadata['~artists_{0}_primary_tags'.format(source_type,)] = tag_list

is where the new variable is created.

The script line that I mentioned:

$set(album_artist_genre,$if2($getmulti(%_artists_album_primary_tags%,0),unknown))

will extract the first genre tag associated with the album artist, and save it in a tag called album_artist_genre. From there you can add it to the appropriate spot in your file naming script, in your case to place the genre at the start of the output path.

1 Like

Should this have pulled the artist genre and used it rather than what is in the DB or only if there was nothing in the DB?

I got the same genre tags as before. Something isnt working quite right in the regular setup as I chose to only pull one item for genre. Despite that setting it is still returning multiple genre tags. I am going to try running a few more tests, see if I need to change up a setting or two.

I updated the plugin this afternoon. It now honors the “Maximum number of genres” setting, but even with the prior version the script line:

$set(album_artist_genre,$if2($getmulti(%_artists_album_primary_tags%,0),unknown))

would still place only one genre in the album_artist_genre tag. Note that this one-liner would need to be in a tagging script (rather than the file naming script) in order for it to be saved as a tag (or show up in the variables list).

1 Like

okay. I thought you has said to drop it in the naming script. I will try it as a tagging. One other idea, is it possible to have a tagging script. I’m thinking for batch tagging. Where someone could select an artist … Reba McEntire … load all of the tracks they have for that artist. The script would set the genre to Country and ignore the Picard DB ?

I suggested the naming script because I thought you had only intended to use the information for file naming (not tagging).

I think you can sort of already do that by setting the tag for the artist on MusicBrainz, and then enable the “Only use my genres” setting in Picard. This limits the tag / genre information provided to Picard to only that which you have provided in MusicBrainz. @outsidecontext provided a bit of an explanation in a comment on my PR – you need to expand the “Show resolved” section to see the discussion.

The updated version of the plugin now properly processes the genres regardless of what settings are enabled.

1 Like

I will try out the updated plugin. It maybe that with that working I wont need to change tags. Thanks again for your help. I’m going to see what work out. I just was hoping to find a simple way to “fix” if necessary tags. I guess misunderstood the part about the tags that I provide. I will go back over the user guide. Have a great evening.

@Bodevan

%SavePerfectAnyway% Is a variable I specified so that when an album is “Over Perfect” or “It’s Perfect (AFAIAC)” … that it will be save in the “Complete” path vs. with the incomplete stuff.

Only an album with a Gold Record (icon) on the Right is considered to be “Perfect” by Picard. Anything else is not.

“Over Perfect” means All the Tracks are present. There may be duplicates, multiple formats, bit rates, or all of these. To me, Complete is all tracks represented.

Such an Album is still complete, just not a perfect single set. So if $iscomplete (check syntax/script for proper use) meaning all the tracks are present regardless of duplicates, then it’s going to the Perfect path anyway.

Or… so what, I say it’s “Perfect Enough for Me”.
(I don’t care, I only want this/these certain tracks, with the album information, art, etc. anyway.) … because I don’t want to treat it as a Single when sorting. It may not be a Single track from an album, but it’s Perfect (Done) for what I’m doing. Put it with the ‘Done’, (Good/Perfect/Complete/Whatever) stuff.

The former happens automagically (if you have it enabled in the config section of the script. It is NOT a setting in Picard.

The latter happens … again, because I said so. Don’t argue with me. Make it So!

(Replied in a more proper thread)

1 Like

Thanks for replying. I see 4 places where you are checking that variable in your script, but I can’t find where it’s being set in the first place (in the v2.7 script). Can you look at it and let me know if it is being set somewhere?

It’s not a configure option in the script, it’s a tag added on a per instance basis.

With the album or all the tracks selected, you either create a tag manually or use a Tagger Script that you manually apply from the contextual menu.

To manually set it just create a new tag (lower part of the window)
called SaveIncompleteAnyway and it’s value is Yes.

When I invoke it by keyboard shortcut it’s just running the “Skip Impartial Save” script which is just doing:

$set(SavePerfectAnyway,yes)

…and then you’ll see a tag named SavePerfectAnyway with a value of Yes. That stays with the album/track and is parsed when loaded again. That is you don’t need to set it each time that Track/Album is loaded into Picard.

If you don’t want it to do that anymore then you just blast the tag and save it again, it will move it to the incomplete.

So anywhere you see something surrounded by %
%ExampleTagName% in the script, it’s checking the tag:
ExampleTagName for whatever value you’ve set.

If you see a leading underscore in there %_ExampleVariableName% then that is NOT a tag. That’s a variable and you’ll find that those are the 1 or 0 values in the config section.

Picard is amazing. As a Disk Image / ROM organizer, the workflow / scripting would be awesome!

(It’s Open Source… I know… stick a Fork in it. Go to town!)

1 Like