Extract first albumartist

Tags: #<Tag:0x00007fe30da6d428>

I can’t manage to script the following: instead of using the whole %albumartist%, I want to use only the first one, that is, the name before the first semicolon. Example: “Johann Sebastian Bach; Keith Jarrett” should return only “Johann Sebastian Bach”.

Any ideas?

I created a plugin to provide this as a script variable, along with a number of other items. Have a look at the description on GitHub for more information or to download a copy.

3 Likes

%_artists_album_primary_std% from above plugin doing a job.

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 ;

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.

2 Likes

Thanks everybody… I ended up using this script:

$left($rreplace($if2(%albumartist%,%artist%),; [^)]+,), 60)/
$if(%albumartist%,%album%/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2) %title%

1 Like