I want to modify my artistsort and composersort actions (simple reversed names of artist and composer) to ignore additional artists/composers.
I use:
$regexp(%composer%,(.) (.),$2',' $1)
Which converts:
Big Bubba
into:
Bubba, Big
and seems to work with most names including initials. I can't make it work with multiple names however. I decided the easiest way was to chose the major artist/composer and include the rest in brackets then include an expression to exclude the bracket contents in the action to reverse the name. I found this:
,(.+?)
However I can't figure out where to place it in the expression.
I would prefer a complete expression that sorts by the first artist/composer and ignores the rest. For example:
Artist: Big Bubba, Miss Piggy, Donald Duck
Into:
Artistsort: Bubba, Big
Regards
Try "Format value" for ARTISTSORT
Format string: $regexp(%artist%,'(.+?) (.+?),.*$','$2, $1')
ARTISTSORT <== $regexp(%ARTIST%,'(.+?)\s(.+?)(,.+?)*$','$2, $1')
DD.20151201.1008.CET
Thank you. They both seem to give the intended result. Much appreciated.
Regards
Actually this works better because it also works with single artist sort so I don't have to change actions.
Regards
EDIT: Is there a way to make this work with artists that have initials?
For example:
Artist:
Big B. Bubba, Miss Piggy
Artistsort:
Bubba, Big B.
At present it formats to:
B. Bubba, Big
Regards
ARTIST <== 'Bubba'
ARTISTSORT <== $regexp($regexp(%ARTIST%,'^(.+?)(,.+?)$','$1'),'^(.+)\s(.+)$','$2, $1')
ARTISTSORT ==> 'Bubba'
ARTIST <== 'Big Bubba'
ARTISTSORT <== $regexp($regexp(%ARTIST%,'^(.+?)(,.+?)$','$1'),'^(.+)\s(.+)$','$2, $1')
ARTISTSORT ==> 'Bubba, Big'
ARTIST <== 'Big B. Bubba'
ARTISTSORT <== $regexp($regexp(%ARTIST%,'^(.+?)(,.+?)$','$1'),'^(.+)\s(.+)$','$2, $1')
ARTISTSORT ==> 'Bubba, Big B.'
ARTIST <== 'Big B. Bubba, Miss Piggy, Donald Duck'
ARTISTSORT <== $regexp($regexp(%ARTIST%,'^(.+?)(,.+?)$','$1'),'^(.+)\s(.+)$','$2, $1')
ARTISTSORT ==> 'Bubba, Big B.'
ARTIST <== 'Bubba, Piggy, Duck'
ARTISTSORT <== $regexp($regexp(%ARTIST%,'^(.+?)(,.+?)$','$1'),'^(.+)\s(.+)$','$2, $1')
ARTISTSORT ==> 'Bubba'
DD.20151201.1636.CET
Thanks. This works beautifully.
Regards