Set Compilation tag to 1 if albumartist = "Various Artists"

Having a bit of trouble of creating corresponding action.

What I am trying to achieve, is to set COMPILATION=1 for all Albums, where ALBUMARTIST is "Various Artists" and set COMPILATION=0 for any other case.

See the definition for COMPILATION:

Notes Field that is used by iTunes to mark albums as compilation. Either enter the value 1 or delete the field.
The easiest way right now would be to

  • load all the files
  • filter them with %albumartist% IS "Various Artists"
  • select all of the filtered files
  • open the extended tags dialogue Alt-T
  • create a new field COMPILATION and set value to 1.
  • click ok until all dialogues are closed to save the modification.

I actually found solution for Action as well:

$if($eql(%ALBUMARTIST%,'Various Artists'),1,)

Just for the record:

The Action "Format Value" with the
Field: COMPILATION
and the
Format String: $if($eql(%ALBUMARTIST%,'Various Artists'),1,)

image

sets the tag COMPILATION to 1 only, if the content of ALBUMARTIST is "Various Artists".
It does NOT set the COMPILATION to 0 (Zero) if the content of ALBUMARTIST is not "Various Artists" but deletes/removes the tag COMPILATION completely.

If you want to set the COMPILATION in any case, you would have to add the 0 (Zero) case using this Format string:
$if($eql(%ALBUMARTIST%,'Various Artists'),1,0)

The defintion of COMPILATION tells us that there is either the value 1 in that field or the field does not exist. So 0 would not be a valid use.

The disadvantage of the action is that it always deletes COMPILATION (if you do not set it to ´0´) , even if COMPILATON has been set to 1 for other artists. This could apply to manually set COMPILATION fields for other ALBUMARTISTS and also ALBUMARTIST fields that do not exactly match the spelling and case of "Various Artists", e.g. "Various Artist" or "various artists" would also lead to either a deleted COMPILATION field or the value ´0´.
And as all these possible variations make it so complicated, I am very fond of filters.

Are you sure?

From the id3.org documentation:

Information
1 if part of a compilation
0 or not present if not part of a compilation

see link to MP3tag documentation:

Yes, @ohrenkino is correct, hence I dropped original idea in favour of simplified and compliant approach.

I have “normalized” ALBUMARTIST field across my library, so misspelling or different case is not an issue.