If, eQ Quandy on When to Use

Two fold: I don’t understand this $eq and how it would relate with $if but what I have is an issue I can’t seem to resolve.

Genre keeps coming up with the wrong information, don’t know where it came from, but it’s there.

I want to be able look, and if Genre has entry populated I want to delete it (or overwrite) it with the correct Genre. I’ve tried everything that I know of with my lack of knowledge and I can’t get it. Very frustrating. Any advice is appreciated :slight_smile: thanks

Have you checked the documentation?

In other languages, you might test for equality with an expression such as:

if (x == y) {
    [actions to take when x and y are the same]
}
else {
    [actions to take when x and y are different]
}

In Picard’s scripting, the equivalent test is:

$if($eq(x,y),
    [actions to take when x and y are the same]
,
    [actions to take when x and y are different]
)    

Where exactly are you seeing this? I assume that you are looking at the genre tag provided by Picard when you have the Use genres from MusicBrainz option enabled. What do you mean by “wrong information”? Is it because these values are different from genre information already in the files’ metadata, or just that you don’t agree with them?

If you don’t want the genre tag written, you can simply use the $delete(genre) command. In fact, the example provided in the documentation actually shows how to remove the genre tag from the output files.

If you want to replace the information in the genre tag with “correct” information, please explain where this new information is coming from. For example, is it an existing tag in the files? As long as Picard has access to the information, it is easy enough to set it as the content of the genre (or any other) tag.

4 Likes