Naming Script could use a couple small\easy tweaks..for nubee

Hi All! I went through about 2 dozen apps trying to better tag and organize my collection, and finally landed on Picard. Its been working good after spending some time configuring to my needs

This Simple Script below I borrowed, and modded slight has been good so far but there are a few tweaks that would really help wit. I am just using the default tagging, ie no special script. What I would like to add to is functionality to create a subfolder under the artist in question for SINGLES, EPS, and LIVE based on the Release Type tag. Thank you

$if(%originalyear%, $set(_year,%originalyear%))
$if($not(%_year%), $set(_year,$left(%date%,4)))
$if($eq(%albumartist%,Various Artists),
$set(_albumartist,[Various Artists]),
$set(_albumartist,%albumartist%)
)

$if2(%_albumartist%,%artist%)
/$if($ne(%albumartist%,),%albumartist% - %album% (%_year%)/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$num(%tracknumber%,2). %artist% - %title%

It’s pretty simple actually.

$if2(%_albumartist%,%artist%)
/$if($ne(%albumartist%,),%albumartist% - %album% (%_year%)/,)
$if($in(%releasetype%,single),SINGLE/)
$if($in(%releasetype%,ep),EP/)
$if($in(%releasetype%,live),LIVE/)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$num(%tracknumber%,2). %artist% - %title%

I haven’t tested that, but it should be pretty close.

1 Like

Thanks Billy - really appreciate your response. :cowboy_hat_face:

Its funny that Im actually a career computer\IT guy that is very familiar w various scripting languages, but seems I am really struggling to understand and learn fundamentals of Picard! Really tried on my own but struggling to find a good tutorial w\ step by steps and supporting examples. (BTW, if anyone can share sources that can help, Im interested) So I am very humbled to ask for help, and am grateful for anyone’s assistance!

So I added the below into Picard and tested. Scratched my head when nothing happened, but then figured out that script is case-sensitive so ‘ep’ tag is different than ‘EP’. Not big deal, but is there anyway to change so its not case sensitive?

Anyways, the input got me closer, but what the script is doing now is creating an EP folder under the Album name instead of vice-versa.

So with your input is now:

Current= Artist > Album > EPs > Files
Wanted= Artist > EPs > Album > Files


$if(%originalyear%, $set(_year,%originalyear%))
$if($not(%_year%),  $set(_year,$left(%date%,4)))
$if($eq(%albumartist%,Various Artists),
    $set(_albumartist,[Various Artists]),
    $set(_albumartist,%albumartist%)
)

$if2(%_albumartist%,%artist%)
/$if($ne(%albumartist%,),%albumartist% - %album% \(%_year%\)/,)
$if($in(%releasetype%,single),Singles/)
$if($in(%releasetype%,ep),EPs/)
$if($in(%releasetype%,live),Live/)
$if($in(%releasetype%,compilation),Compilation/)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$num(%tracknumber%,2). %artist% - %title%

THANKS!!!

I inserted my additions in the wrong place. It should have been before the second line.

$if2(%_albumartist%,%artist%)
/
$if($in(%releasetype%,single),Singles/)
$if($in(%releasetype%,ep),EPs/)
$if($in(%releasetype%,live),Live/)
$if($in(%releasetype%,compilation),Compilation/)
$if($ne(%albumartist%,),%albumartist% - %album% \(%_year%\)/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$num(%tracknumber%,2). %artist% - %title%

Naming scripts can be a little hard to wrap your mind around, probably because we keep calling them “scripts” when they’re really not. Really, they’re just very complex output format strings or mail-merge definitions. You can’t think of them in the same way as scripts that perform tasks. What’s actually happening is we’re assembling long text strings from constants and variables.

3 Likes

Working as it should now. Awesome…Thank you!

Theres once last tweak I want to make though and I spent last couple hrs trying to fix it. Seems so trivial, but damn if I could figure it out --:sweat:

For the single release types its wanting to put each file in its own folder under ‘Singles’. Whats the secret to having the files tagged as singles dumped directly into the root of ‘Singles’ subfolder?

Could you give an example? A screenshot of the folder structure and a link to the corresponding MB release might help us figure it out.

Sure. So I’ll give you my actual process as well in case Im doing it wrong. So drag these into the app and Picard is wanting to add these misc singles as part of an album. Some are legit singles, others are from soundtracks, other artists albums.etc. But I want them to show up as Singles in my folder structure. Im pulling them out of those albums back to the unclustered section and manually editing the tags. Namely I make them all 'Track" = 1, ‘Releasetype’ = single, and I remove the album name. Then save - Tag\Rename\Move and this is the folder structure I get under ‘Singles’. Prefferably I would like to leave the album tag in there, but thought that may hve somethng to do with the extra sub-folders. It was including the Album name in the folder previously before I did that. This folder creation is obviously fine behaviour for EPs, Compilations, etc…

It’s because of the year. You’re using %_year% in the folder name, so naturally each different year gets its own folder. And yes, if you left the album tag populated, then each different value for %album% would create a different folder also.

I may have lost you a bit I think… If I delete the ‘year’ and ‘album’ tag I still get a subfolder under Singles with just the artist name. So in this example its named ‘Eminem - ()’ .now. Seems like there should be a way for the script to not create a seperate subfolder for each song. So if it has the ‘releasetype’ = ‘single’ tag then just move the file to the Singles folder and be done. The current script logic works fine for other release types like EPs, Live Albums, Compilations, etc since they all would have multiple files and the seperate subfolders would be warranted. So for Singles I want it to look like this::

Again attached current script below.

$if(%originalyear%, $set(_year,%originalyear%))
$if($not(%_year%), $set(_year,$left(%date%,4)))
$if($eq(%albumartist%,Various Artists),
$set(_albumartist,[Various Artists]),
$set(_albumartist,%albumartist%)
)

$if2(%_albumartist%,%artist%)
/
$if($in(%releasetype%,single),Singles/)
$if($in(%releasetype%,ep),_EPs/)
$if($in(%releasetype%,live),_Live-Albums/)
$if($in(%releasetype%,compilation),_Compilation-Albums/)
$if($ne(%albumartist%,),%albumartist% - %album% \(%_year%\)/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)
$num(%tracknumber%,2). %artist% - %title%