Looking for a Regex guru to help me with this one please
I am making use of a custom tag ‘Guest Artist’ and want any artists that appear as a second, third, fourth etc. value in Artists to be copied into this tag. I do not want the first (main) artist when there is only one value in Artists
I tried
$setmulti(Guest Artist,$rreplace(%artists%,^[^;]*;,))
Which works on multi-artist tracks as planned but returns Artist1 for tracks which only have a single artist
The reason it isn’t removing the first artist (when there is only one artist) is because there is no semi-colon in the %artists% string to allow a match for replacement.
If you wanted to do it with your regular expression, after running it simply check whether %Guest Artist% is equal to %Artist1% (or whatever you call it in your script) and if so set Guest Artist to “”. The code would look something like:
Just realised i posted this in the wrong thread (doh)
Thanks for the quick responses i did try your plugin, it is excellent but it seems to bring back slightly different values from what is in Artists and would require further manipulation to correct.
I used $setmulti(Guest Artist,%_artists_track_additional_std%)
Results on this track:
Title: 1st & 10 (feat. Infamous 2-0 & Fate Wilson)
Artists: Ludacris; Infamous 2-0; Fate Wilson
Guest Artist: I-20 & Fate Wilson
Thats why i was keen to take all artists after the first from %Artists% so i know the results come back consistent
EDIT also tried _artists_track_additional_cred but comes up with the same result. Note the different spelling of artists in Guest Artist and no multi-value ;
Darn theres an issue with the above and Guest Artist for single artist tracks is still coming out as Artist1.
I notice when i try to wrap Guest Artist with %'s in scripting it complains there is an illegal " " (space) character in the middle. I think without the %'s the $eq item isn’t able to match the two
That doesn’t really surprise me. Spaces in tag names can be a problem. To get around this, use a temporary tag name and then assign it to Guest Artist later. Something like:
That was actually a shortcoming of the plugin. There was no variable provided in a proper multi-value format for the artist information. I’ve updated the plugin to provide these additional variables. The latest version is available at GitHub.