Tags: #<Tag:0x00007f756fbbe770>

Since I’m playing music on a fairly simple player, I’d like to tag my classical music with the composer as the artist (while recording performers in other tags). I’ve tried the following script:


The $copy works fine, but it happens for all tracks, not just those that have a genre that starts Classical. Am I misunderstanding how to use the $if conditional here?

You do know that most classical music in MusicBrainz is already tagged with the composer as the track artist? If it’s not tagged that way, it should be corrected to follow the Classical Style Guide

Regarding your script, I’m not sure if this is the problem but it looks like it’s missing an Else.

No, you discovered a bug in $startswith, it cannot currently be used like it would be expected. $if($startswith(%genre%,Classical),...) is always true. This is a bug.

A workaround with $startswith is:


Also the solution with startswith only works if Classical is the very first genre tag. It doesn’t matter if there is only one, but maybe you want to check if any tag is classical:


Update: Will get fixed in the next release, see

In the meantime $if in combination with $startswith, $endswith and $is_complete should be used in combination with $eq check for “1”. Examples:


Thanks for reporting


Classical Extras plugin was rewriting the Artist tag! I’ll need to look at the CE options to stop that happening.

1 Like