Question about [Live] suffix on Scripting Documentation page

I’ve modified the following Scripting example…

$if($and($eq(%releasetype%,live),$not($in(%title%,\(live\)))),$set(title,%title% \(live\)))

So that it adds [Single], [EP], [Compilation], etc to the album tag.

$if($and($eq(%releasetype%,single),$not($in(%album%,[Single]))),$set(album,%album% [Single]))
$if($and($eq(%releasetype%,ep),$not($in(%album%,[EP]))),$set(album,%album% [EP]))
$if($and($eq(%releasetype%,compilation),$not($in(%album%,[Compilation]))),$set(album,%album% [Compilation]))
$if($and($eq(%releasetype%,live),$not($in(%album%,[Live]))),$set(album,%album% [Live]))

[Single] and [EP] work. However, the [Live] and [Compilation] DO NOT. I assume because they are secondary items that also contain ‘album’? I’m also confused as to what $not does.

Any help would be appreciated!


Ok I just figured out the problem. I changed it to %releasetype%,album; live to correctly mimic the original tag. Unsure if that is the cleanest way to do it though.

$if($and($eq(%releasetype%,album; live),$not($in(%album%,[Live]))),$set(album,%album% [Live]))
$if($and($eq(%releasetype%,album; compilation),$not($in(%album%,[Compilation]))),$set(album,%album% [Compilation]))

I would still appreciate if someone could chime in on what $not is doing here.

The proper way to do this is the answer given at:

@Billy_Yank is using $in to check if the value you are looking for is included in the list. Even cleaner would be using $inmulti:

$if($and($inmulti(%releasetype%,compilation),$not($in(%album%,[Compilation]))),$set(album,%album% [Compilation]))
$if($and($inmulti(%releasetype%,live),$not($in(%album%,[Live]))),$set(album,%album% [Live]))

It inverses a condition. So the following prints “[SINGLE]” if %releasetype% does contain single:


And this prints “[NOT SINGLE]” if %releasetype% does not contain single:

$if($not($inmulti(%releasetype%),single),[NOT SINGLE])