Hi, my first post here.
I’ve been using Picard for a few weeks now, and I’ve set up some scripts to get what I want.
I’ve hit a stumbling block with a scenario that should be easy, but seems to be impossible for me to work out.
I want to change performer tags with no instruments to a tag called performer:various, but I only want to do it where the person is not already listed somewhere else as a performer for the track.
For instance, Ed Sheerin is listed as performer on this track, as well as vocals and guitar. https://musicbrainz.org/recording/07a4f279-5499-4338-bec5-a00dca4b1037?tport=8000
benny blanco and Rick Ruben are both listed as performers, along with Ed Sheerin, but neither have another performer role, so I’d like them to display as performer:various.
If I set each one as a separately labelled tag it works:
welcome dmcswee i wish i could help but scripting is a bit above my head someone like jesus2099 may be able to help you you may just need to wait till they see it due to time zones and life while you wait take a look around there is plenty of talk around scripts on here you may find something that may help while looking
Instead of $setmulti for setting the performer:various tag you better should use $copymerge, to retain previously set values
$copymerge behaves a bit different as you had expected: It needs variable names for both the first and second parameter, not actual values ($copymerge(a,b) instead of $copymerge(a,%b%)).
So with this the script should I think be like this. Note the call to $copymerge(performer:various,_loop_value), and I also added some comments to other parts of the script:
$setmulti(_perflist,$performer(,; ))
$noop(The following copymerge is not really needed, but it ensures
_perflist contains only unique values. It doesn't change the working of
the script, but maybe _perflist is used elsewhere)
$copymerge(_perflist,_perflist)
$noop(Again not really needed I think, but makes sure performer is
an actual multi-value tag)
$setmulti(performer,%performer%)
$foreach(%performer%,
$if($not($inmulti(%_perflist%,%_loop_value%)),
$copymerge(performer:various,_loop_value))
)
$unset(performer)
And I also want to say that your script is really really awesome. I think this is a great idea which makes use of the more advanced possibilities in scripting. This gets into my personal collection of useful scripts.
Thanks, st3v3p. I’ve been lurking and browsing the forums for a while, and I was just stuck. There certainly is a whole lot of knowledge and advice here and I’ve already picked up some things and put them in place.
Thanks heaps outsidecontext, this works perfectly. I had tried $copymerge, and various iterations of using $setmulti, $copymerge and $set different combinations. If anyone can see a log of Picard requests for that Ed Sheeran album (being it contained a perfect example of what I was trying to achieve) there’s probably some 500 odd attempts at refreshing and changing the script to see if it worked.
I like to think I’m pretty good at scripting and coding in general, and it was just a matter of specific syntax. The tagger script syntax is a little awkward to get used to so I just couldn’t work it out.
I’m glad I can contribute to your personal collection! I’ve already added many of your contributions from across the forum to my collection.