How do you manage Soundtrack?

Hi thwere,

I was wondering how do you mange your soundtrack…

For no soundtrack album I set renaming script to something like:

Artist Name - Title (year) …(other stuff)

but for soundtrack I think it was better something like this:

Title of film - Artist name (year) …(other stuff)

In last case… how do you indicate to MBP that album A is a soundtrack or no?

I worte something like this:

$if($or($in(_secondarytypes,soundtrack),
       $in(_secondarytypes,ost),
       $in(_secondarytypes,original motion picture),
       $in(_secondarytypes,original motion picture soundtrack)),
    $set(_basepath,$rreplace(%_album% - %_albumartistname% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, )),
    $set(_basepath,$rreplace(%_albumartistname% - %_album% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, ))
)

but it doesnt work properly…
every album is now set as follow:

Title - Artist name (year) …(other stuff)

I’m guessing it’s because you don’t have the percent signs around _secondarytypes in your $in() statements.

2 Likes

UH! …I see!!!

Thank so much I’ll try to mod

1 Like

I tried this:

$if($or($in(%_secondarytypes%,soundtrack),
       $in(%_secondarytypes%,ost),
       $in(%_secondarytypes%,original motion picture),
       $in(%_secondarytypes%,original motion picture soundtrack)),
    $set(_basepath,$rreplace(%_album% - %_albumartistname% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, )),
    $set(_basepath,$rreplace(%_albumartistname% - %_album% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, ))
)

but it doesnt work again…

This is my full script:

$set(_album,%album%)
$set(_album,$trim(%_album%))
$set(_album,$rreplace(%_album%, {2\,}, ))

$set(_albumartistname,$swapprefix(%albumartist%))
$set(_albumartistname,$trim(%_albumartistname%))
$set(_albumartistname,$rreplace(%_albumartistname%, {2\,}, ))

$set(_artistname,$swapprefix(%artist%))
$set(_artistname,$trim(%_artistname%))
$set(_artistname,$rreplace(%_artistname%, {2\,}, ))

$set(_year,$left($if2(%date%,%originaldate%,0000),4))
$set(_format,$upper(%_extension%))
$set(_audio,$if2(%_bits_per_sample%,0)-$div($if2(%_sample_rate%,0),1000))
$set(_catno,$if2(%catalognumber%,No Cat Number))
$set(_catno,$replace(%_catno%, ,_))
$set(_catno,$replace(%_catno%,-,_))
$set(_label,$if2(%label%,No Label))
$set(coverart,%coverart_url%)

$set(_disccount,$if($gt(%totaldiscs%,1),%totaldiscs%Discs))

$set(_secondarytypes,$lower($replace($if2(%_secondaryreleasetype%,),;, )))


$if($or($in(%_secondarytypes%,soundtrack),
       $in(%_secondarytypes%,ost),
       $in(%_secondarytypes%,original motion picture),
       $in(%_secondarytypes%,original motion picture soundtrack)),
    $set(_basepath,$rreplace(%_album% - %_albumartistname% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, )),
    $set(_basepath,$rreplace(%_albumartistname% - %_album% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, ))
)

$if($gt(%totaldiscs%,1),
$set(_basepath,
$if(%discsubtitle%,%_basepath%/$num(%discnumber%,2) %discsubtitle%,%_basepath%/Disc $num(%discnumber%,2))))


$if($gt(%totaldiscs%,1),
%_basepath%/$num(%discnumber%,2)-$num(%tracknumber%,2) %title%,$if($and(%albumartist%,$ne(%albumartist%,%artist%)),%_basepath%/$num(%tracknumber%,2) %title% - %artist%,%_basepath%/$num(%tracknumber%,2) %title%))

This seems to be working

$set(_album,%album%)
$set(_album,$trim(%_album%))
$set(_album,$rreplace(%_album%, {2\,}, ))

$set(_albumartistname,$swapprefix(%albumartist%))
$set(_albumartistname,$trim(%_albumartistname%))
$set(_albumartistname,$rreplace(%_albumartistname%, {2\,}, ))

$set(_artistname,$swapprefix(%artist%))
$set(_artistname,$trim(%_artistname%))
$set(_artistname,$rreplace(%_artistname%, {2\,}, ))

$set(_year,$left($if2(%date%,%originaldate%,0000),4))
$set(_format,$upper(%_extension%))
$set(_audio,$if2(%_bits_per_sample%,0)-$div($if2(%_sample_rate%,0),1000))
$set(_catno,$if2(%catalognumber%,No Cat Number))
$set(_catno,$replace(%_catno%, ,_))
$set(_catno,$replace(%_catno%,-,_))
$set(_label,$if2(%label%,No Label))
$set(coverart,%coverart_url%)

$set(_disccount,$if($gt(%totaldiscs%,1),%totaldiscs%Discs))

$if($or($inmulti(%_secondaryreleasetype%,soundtrack),$inmulti(%_secondaryreleasetype%,Soundtrack)),
    $set(_basepath,$rreplace(%_album% - %_albumartistname% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, )),
    $set(_basepath,$rreplace(%_albumartistname% - %_album% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, ))
)

$if($gt(%totaldiscs%,1),
$set(_basepath,$if(%discsubtitle%,%_basepath%/$num(%discnumber%,2) %discsubtitle%,%_basepath%/Disc $num(%discnumber%,2))))

$if($gt(%totaldiscs%,1),
%_basepath%/$num(%discnumber%,2)-$num(%tracknumber%,2) %title%,
$if($and(%albumartist%,$ne(%albumartist%,%artist%)),
%_basepath%/$num(%tracknumber%,2) %title% - %artist%,
%_basepath%/$num(%tracknumber%,2) %title%))

That’s because the variable should be %_secondaryreleasetype% and not %_secondarytypes%. I didn’t catch this the first time I looked at this because I assumed that you had used the correct variable. I should know better than to assume anything.

Also, the only valid items in %_secondaryreleasetype% are (currently) “audiobook”, “compilation”, “dj-mix”, “interview”, “live”, “mixtape/street”, “remix”, “soundtrack”, or “spokenword”. Don’t bother checking for the other items like “ost”, “original motion picture” or “original motion picture soundtrack” because they will never match.

3 Likes

I corrected as follow:

$if($or($inmulti(%_secondaryreleasetype%,soundtrack),$inmulti(%_secondaryreleasetype%,Soundtrack)),
    $set(_basepath,$rreplace(%_album% - %_albumartistname% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, )),
    $set(_basepath,$rreplace(%_albumartistname% - %_album% %_disccount% \(%_year%\) %_format% %_audio% %_catno% %_label%, {2\,}, ))
)

That should work. You actually don’t need the second check for “Soundtrack” because the valid options are all lower case.

Also, I didn’t look at the code for the actual formatting. I see you are using a regular expression replacement, although I’m not sure what this is intended to accomplish.

I’m curious… Are you coding this yourself or are you trying to use some AI code generator?

3 Likes

Unfortunately i’m not able in coding; I just learned something in the online manual: I used Gemini and ChatGPT for basic code… after of that I corrected some errors.

I wonder: %_secondaryreleasetype% where is placed in file info?

I found “Release type” but no a “secondary release type” infos…

…to eventually manually edit it…

In that case, I’m not going to be so quick to provide support. I have better things to do with my time than fix up AI generated garbage.

2 Likes

I’m really sorry!
…thank so much however for your help :slight_smile:
God bless

It’s under basic variables in the documentation.

2 Likes

Yes thanks I kew… and I read it

But I do not find it inside file info in Picard:

I found only _primaryreleasetype which is, I presume, “Release Type” as follow:

Immagine 2025-08-30 205936

But I dont know where _secondaryreleasetype has been placed (if there is of course)

I set language in English because of variable names; in italian that field is “Tipo di pubblicazione” as follow:
Immagine 2025-08-31 205936

And sorry for misunderstanding because of my bad english;
this is not my native language and very often I fall in misunderstanding…

I forgot something:

My question is due to intention of manually change value of _secondaryreleasetype when it is not specified to “force” Picard write directory name as:

Title - Artist Name (year) …(other stuff)

also when in primary relase type there is only something like : album or similar and not “soundtrack”

Example:

Joe Hisaishi - Nausicaa Of The Valley Of The Wind_ Hi-Tech Series (1989) FLAC 16-44 30ATC_187 Animage

As you see the Artist Name is before the title; but that title is the name of anime by Ghibli Studios.

in other words I was wondering where I have to put “soundtrack” to obtain:

Nausicaa Of The Valley Of The Wind_ Hi-Tech Series - Joe Hisaishi (1989) FLAC 16-44 30ATC_187 Animage
Immagine 2025-08-31 091955

As you see in Primary relase there is soundtrack that I forced manually… but the renaming was wrongly put Artist name before the film/anime Title

You’re confusing tags versus variables. Variables beginning with an underscore will not be written to the file as tags, so do not show up in the metadata list. This is explained in the documentation (which you really should read). See:

1 Like

Thank so much forr your patience and kindness :slight_smile:

I’ll read it again hopefully with a better transaltion than Google; As i said before my english is bad and maybe any misunderstainding could happen…

1 Like

@rdswift

Just a P.S.

I’m not expert in coding as i said but I try to understand something for me obscure which manual is in other language… and thanks to AI I obtained somehow

This for example is a sort of little manual of my script which I tried to compile:

https://www.mediafire.com/file/bpduqy7ab62083l/Script_PERSONALI_MusicBrainz_PICARD_rel_2.1_aggiunto_n.ro_disco_nei_album_multi_disco.docx/file

obviously is in Italian

Thank so much again for everything :slight_smile:

1 Like