Help Clean Up my Script!

Is there anybody out there who could help me clean up my script, please. I know very little about this language but I can piece (Hack) a bunch together to get what I need. What I am trying to achieve is…
(This is good)
[1980] Wild-Eyed Southern Boys [US - A&M Records - CD 3298 - CD - 1981] [320K]
This is bad)
[1979] Rockin’ Into the Night [US - - - Digital Media - 2005] [256K]

I would like everything within the brackets to be straightforward no empty spaces with just dashes.
And this is my code I am using:

$if($eq($or(%originaldate%,%date%),1),

[$left($if2(%originaldate%,%date%),4)] %album% [%releasecountry% - %label% - %catalognumber% - %media% - $left($if2(%date%),4)])

$noop($set(_numbr,$left(%_bitrate%,3)))

$set(_numbr,$div(%_bitrate%,1000))

$if($eq(%_bitrate%,320.0),$set(_folderbr,320),

$if($eq(%_bitrate%,256.0),$set(_folderbr,256),

$if($eq(%_bitrate%,192.0),$set(_folderbr,192),

$if($eq(%_bitrate%,160.0),$set(_folderbr,160),

$if($eq(%_bitrate%,128.0),$set(_folderbr,128),

$if($eq(%_bitrate%,64.0),$set(_folderbr,64)))))))

$if(%_folderbr%,

$if($gte(%_numbr%,220),$set(_folderbr,V0),

$if($lt(%_numbr%,220),$set(_folderbr,V2),

$set(_folderbr,Err1)

)))

$if($eq($upper(%_extension%),MP3), [%_folderbr%K])

Also is there a way to show how many disks are in a multiset release like this?
VA - Driven By The 60s (5CD)

If you want the dashes and spaces to disappear when the variable is empty, you’ll need to use if statements for each of the variables.

For example:
$if(%releasecountry%,%releasecountry% - )

2 Likes

Thank You Billy_Yank Worked great.
Also is there a way to show how many disks are in a multiset release like this?
VA - Driven By The 60s (5CD)

I think that would be:

%totaldiscs%%media%

1 Like

Billy_Yank you rock!
since we are on a roll the last thing is I only want it to display %totaldiscs%%media% if the album is more than 1 disc?
I really appreciate your help!

Try something like:

$if($gt(%totaldiscs%,1),%totaldiscs%%media%,)

Seems to be working Thank You so much! :wink: