File naming script - strange behaviour - different results with the same script

Hi everyone,

I noticed my file naming script is giving me different results on different releases.

My script:

$set(media,$upper(%media%))
$if($find(%media%,DIGITAL),$set(media,WEB))
$if($find(%media%,CD),$set(media,CD))
$if($find(%media%,CD-R),$set(media,CD-R))
$if($find(%media%,DVD),$set(media,DVD))
$if($find(%media%,VINYL),$set(media,VINYL))
$if($find(%releasetype%,compilation),$set(releasetype,Compilation))
$if($find(%releasetype%,album),$set(releasetype,Album))
$if($find(%releasetype%,ep),$set(releasetype,EP))
$if($find(%releasetype%,mixtape/street),$set(releasetype,Mixtape))
$if($find(%releasetype%,single),$set(releasetype,Single))
$if($find(%releasetype%,live),$set(releasetype,Live))
$if($find(%releasetype%,Enhanced CD),$set(releasetype,CD))
$if($find(%releasetype%,Copy Control CD),$set(releasetype,CD))
$if($find(%releasetype%,bootleg),$set(releasetype,Bootleg))
$if($find(%releasetype%,dj-mix),$set(releasetype,DJ-Mix))
$if($find(%releasecountry%,XE),$set(releasecountry,EU))
$if($find(%releasecountry%,XW),$set(releasecountry,World))
$if($find(%catalognumber%,[none]),$set(catalognumber,none))
$if($find(%releasestatus%,promotion),$set(releasestatus,Promo))
$if($find(%releasetype%,other),$set(releasetype,Misc))
$if($find(%releasetype%,spokenword),$set(releasetype,Misc))
$if2(%albumartist%,%artist%)/$if($eq(%albumartist%,Various Artists),%releasetype%)/
$if(%date%,%date%,0000)- $replace(%album%,:, -)
[$if($gt(%totaldiscs%,1),%totaldiscs%x)%media%, %releasetype%$if($ne(%releasestatus%,official), %releasestatus%)]
$if(%catalognumber%,[%catalognumber%],)
$if(%releasecountry%,[%releasecountry%],)/
$if($gt(%totaldiscs%,1),%discnumber%-,)$if($ne(%albumartist%,),$num(%tracknumber%,2),) - $if(%_multiartist%,%artist% - ,)%title%

Result for this release in my directory: 2014-12-01- Spark the Fire [WEB, Single] [US]

Result for this release in my directory: 2006- Wind It Up [CD, Single] [00602517173873][EU]

Why is there no space between cat.no & country in the second example?
It drives me nuts

You need a space after the ] i.e. $if(%catalognumber%,[%catalognumber%] ,).

2 Likes

Aah, I was trying to add space after the coma. Thank you so much!

1 Like