I’m trying to automatically replace “Various Artists” album artist tags with the Compiler/DJ, or if that’s not available, with the label (I hate VA, I find it useless. I know this is not for everyone).
I’m guessing your $and should be a $or, or you might be getting tripped up by the spaces in your $if2 functions. In addition, your brackets are mismatched. Personally, I would have written it as:
This looks for a match on the “Various Artists” ID and the albumartist being “Various Artists” – only triggering if both conditions are met. Checking for both conditions addresses the potential problem in cases where the albumartist is credited to something other than “Various Artists”. That condition could also be addressed by checking the “Use standardized artist names” box under Options -> Metadata.
It also adds a default “Unknown” if all of the %compiler%, %djmixer% and %label% tags are empty.
https://musicbrainz.org/release/2255f75e-24c4-4a04-9e43-805ed12e1b6d has two DJ-mixers credited to the release, which means `%djmixer% is likely a multi-value tag and I’m not sure if Picard automatically translates those into a nice string, so you may have to do something to make sure the variables you use are always added as strings.
Just tried the script I offered above in Picard with the two examples you listed. In the first case, both the “Album Artist” and “Album Artist Sort Order” entries show as “Circus Records; UKF Music”. Note that both parts of the multi-value field are shown separated by a semi-colon. In the second example, the “Album Artist” and “Album Artist Sort Order” entries are both set to “Rounder”, as expected. I am assuming (which can be dangerous) that a multi-value field there would be presented the same way as in your first example.
Hrm, the Doctor P/Flux Pavilion release (https://musicbrainz.org/release/2255f75e-24c4-4a04-9e43-805ed12e1b6d) actually does already include “compiler” tags, but they don’t come across into Picard for some reason? Seems odd that the record variable is available but the compiler one is not…