Using %ifdef

I’m trying to use %ifdef in my path configuration. I’d like to add a %ifdef to only add a $label if one is found. If no label is found, ignore label.

My current config:

$albumartist - $original_year - $album ($label) [$format]

If a label is not found I’m left with () in the folder name.

When I use %ifdef($label), and a label is found, the folder reads %ifdef(Empire Records). If no label is found I get %ifdef().

When I use %ifdef{$label} the label is omitted entirely.

Am I not using the correct function? Is my syntax missing something?

Try %ifdef{label,$label}, perhaps?

Thanks for the input. I actually just got it going with %ifdef{label,($label)}. But, if no label was found, I was getting an extra space in the folder name.

In the end, this is my solution.

%ifdef{label,($label) }

This will remove the extra space if no label is found and apply ($label) if found.