Need help with script to set DJ-Mixer tag conditionally

Picard scripting keeps confounding me. :weary: Can someone explain to me how to do the following? What I want to do is this:

If the “Release Type” tag contains both ‘dj-mix’ and ‘compilation’, and the Album Artist tag is not “Various Artists”, then the DJ-Mixer tag must be set to whatever the “Album Artist” tag is.

E.g.:

Album Artist: John Doe
Release Type: album; compilation
/* Do not set DJ-Mixer tag */

Album Artist: Various Artists
Release Type: album / compilation / dj-mix
/* Do not set DJ-Mixer tag */

Album Artist: Tom Dick’n’harry
Release Type: album / compilation / dj-mix
/* Set DJ-Mixer to Album Artist, i.e. Tom Dick’n’harry */

Note that the ‘Release Type’ contains multiple tags that in Picard show as either being separated by ’ / ’ (space-slash-space) or by '; ’ (semicolon-space) which may or may not be relevant in script syntax.

So far I have:

$if(
  $and(
    $and(
      $inmulti(%releasetype%,compilation),
      $inmulti(%releasetype%,dj-mix)
    ),
    $not($eq(%albumartist%,Various Artists))
  ),$set(%djmixer%,%albumartist%)
)

But that doesn’t work. I also tried using $lower() to make comparisons case-insensitive, but that doesn’t work either. (I’d prefer case-insensitivity.)

What am I missing? All suggestions appreciated!

// FvW

The scripting is very space sensitive, as everything is a string, and spaces are not considered empty.

Try this:

$if($and($inmulti(%releasetype%,compilation),$inmulti(%releasetype%,dj-mix),$not($eq(%albumartist%,Various Artists))),
  $set(%djmixer%,%albumartist%))
1 Like

That didn’t work either but I found the problem: I need to set dj-mixer, not %dj-mixer%. :grinning:

Oops. My bad. Thanks for rubberducking me!

4 Likes