Need help on scripting

Tags: #<Tag:0x00007f0507ee6610> #<Tag:0x00007f0507ee6408>


Hi, I’m fairly new to the scripting protocols and have had some success but am having problems with this one.

Unlike some other patrons :slight_smile: I do like organizing Soundtracks as a genre. It just always made it easy for me to find them.
Here’s the script I was trying


I tried variations as well

I would love to see where I went wrong here.


First off: you need to have all the if clauses inside the if statement. If you do $if(foo,bar),$anything_else_here() (noticed how the parentheses are paired) the $anything_else_here() will always get evaluated. You need to do $if($eq(foo,bar),$anything_else_here()).

Anyway, on top of that, %releasetype% is a multi-value variable, so you want to use $inmulti(). Try this and see if it works for you:

$if($inmulti(%releasetype%,soundtrack),$set(genre,Soundtrack),$noop(We could set %genre% to %genre% here, but %genre% should already equal %genre%, so…))

(Note that there’s also a “hidden” variable %_secondaryreleasetype%, but I’m not sure how that works for releases with multiple secondary release types.)


Ok thanks so much for the help
Really appreciate learning the inmulti

So I tried
But I have an error that won’t let me "make it so"
It says unexpected character ‘)’ at position 69…
Basically it doesn’t like the last set and I don’t know why?

What am
I doing wrong?


If you open 3 brackets “(” then you need to close it 3 times with “)”:

As you maybe know: $noop() does nothing, just adds a remark


To add on to what @InvisibleMan78 said, $noop() does nothing, but it’s still a function, so if you write $noop you have to follow up with a ( and ), so


should work. Or just remove the ,$noop() entirely, as @InvisibleMan78 suggested.


got it - all working well now thanks!!

One other question - if I wanted to add “Soundtrack” to the genre - in addition to the other genres, then I guess it would be a different command right? It wouldn’t be $set … but what would I use in that case?