Author Topic: Is there anyway to separate multiple Album Artists with a comma and a &?  (Read 1458 times)

REVOFEV

  • Newbie
  • *
  • Posts: 6
For example, in order to separate multiple Album Artists in MusicBee is by using a Semicolon:



However, I would like to display the Album Artists using a comma and a & at the end of the last artist and still be able to separate them in the Album Artist category:



Is this possible? Can anyone help? Thanks!

tjinc

  • Sr. Member
  • ****
  • Posts: 830
Welcome to the forum REVOFEV,

You can do this using a virtual tag (and you would then display this virtual tag in place of the currently displayed <Album Artist> field). I don't know if you know much about these, so here's a couple of useful links - it is better if you try to gain an understanding:
Wiki Page
List of functions

A simple solution would simply be to replace the ";" characters with "," using something like:
Code
$Replace(<Album Artist>,;,",")

If you really want the "&" character before the last album artist it gets somewhat more complex. I think this will work for up to three album artists:
Code
$Split(<Album Artist>,;,1)$If($Split(<Album Artist>,;,2)="",,$If($Split(<Album Artist>,;,3)=""," & "$Split(<Album Artist>,;,2),", "$Split(<Album Artist>,;,2)" & "$Split(<Album Artist>,;,3)))
If you have any tracks tagged with four or more Album Artists then you would have to modify this code.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
Quote from: tjinc link=topic=40796.msg221356#msg221356 mdate=1709316391
If you really want the "&" character before the last album artist it gets somewhat more complex. I think this will work for up to three album artists:
I haven't tested the following (replying from my mobile), but I -just might- be that brilliant, haha just might:
$Replace($RxReplace(<album artist>, "(.*);( .*)","$1 &$2"),";",",")

Let me know if it works for all variants?
Strength and Honour (2025)

tjinc

  • Sr. Member
  • ****
  • Posts: 830
$Replace($RxReplace(<album artist>, "(.*);( .*)","$1 &$2"),";",",")
That's very nice Mayibongwe - RegEx still eludes me. That does look like it works (and is much more condensed that my attempt).

I haven't tested the following (replying from my mobile), but I -just might- be that brilliant, haha just might:
And modest!  :D

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
Especially modest😂

Regular Expressions are so much fun to play with.
When i first took a glance at them, I couldn't help but wonder what was the magic behind all the asterisks and the periods.
Before long, I found myself deep in the previous Lyrics Reloaded topic (that's where most of the searches turned up)
Strength and Honour (2025)

REVOFEV

  • Newbie
  • *
  • Posts: 6
Welcome to the forum REVOFEV,

You can do this using a virtual tag (and you would then display this virtual tag in place of the currently displayed <Album Artist> field). I don't know if you know much about these, so here's a couple of useful links - it is better if you try to gain an understanding:
Wiki Page
List of functions

A simple solution would simply be to replace the ";" characters with "," using something like:
Code
$Replace(<Album Artist>,;,",")

If you really want the "&" character before the last album artist it gets somewhat more complex. I think this will work for up to three album artists:
Code
$Split(<Album Artist>,;,1)$If($Split(<Album Artist>,;,2)="",,$If($Split(<Album Artist>,;,3)=""," & "$Split(<Album Artist>,;,2),", "$Split(<Album Artist>,;,2)" & "$Split(<Album Artist>,;,3)))
If you have any tracks tagged with four or more Album Artists then you would have to modify this code.
This worked PERFECTLY!



TWO Album Artists:



If there's anyway, I would like one where there's 8 different Album Artists, that would be sweet.

Quote from: tjinc link=topic=40796.msg221356#msg221356
If you really want the "&" character before the last album artist it gets somewhat more complex. I think this will work for up to three album artists:
I haven't tested the following (replying from my mobile), but I -just might- be that brilliant, haha just might:
$Replace($RxReplace(<album artist>, "(.*);( .*)","$1 &$2"),";",",")

Let me know if it works for all variants?
For some reason when I tried this the word "KIDS SEE" would fuse to "KIDSSEE" and albums with TWO artists would just be in commas instead of ARTIST 1 & ARTIST 2:





I definitely would not come close to figuring this out. Glad I came here and posted about it! ;D

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
For some reason when I tried this the word "KIDS SEE" would fuse to "KIDSSEE" and albums with TWO artists would just be in commas instead of ARTIST 1 & ARTIST 2:
My bad, it should work.
After testing it, I've just removed an extra space which had slipped through just before the first opening quote symbol after <album artist>.
Code
$Replace($RxReplace(<album artist>,"(.*);( .*)","$1 &$2"),";",",")
Strength and Honour (2025)

REVOFEV

  • Newbie
  • *
  • Posts: 6
For some reason when I tried this the word "KIDS SEE" would fuse to "KIDSSEE" and albums with TWO artists would just be in commas instead of ARTIST 1 & ARTIST 2:
My bad, it should work.
After testing it, I've just removed an extra space which had slipped through just before the first opening quote symbol after <album artist>.
Code
$Replace($RxReplace(<album artist>,"(.*);( .*)","$1 &$2"),";",",")
Worked. Thanks!

Do I need to keep adding on if there's more than 3 artists? Will it work the same way?

tjinc

  • Sr. Member
  • ****
  • Posts: 830
Do I need to keep adding on if there's more than 3 artists? Will it work the same way?
No, the beauty of Mayibongwe's solution is that it will work with any number of Artists.

(I can see what you did here Mayibongwe, so maybe I can use this as an example to learn a little more about RegEx)

REVOFEV

  • Newbie
  • *
  • Posts: 6
Do I need to keep adding on if there's more than 3 artists? Will it work the same way?
No, the beauty of Mayibongwe's solution is that it will work with any number of Artists.

(I can see what you did here Mayibongwe, so maybe I can use this as an example to learn a little more about RegEx)
Ah, perfect. Yes, I see it working.

Any idea how I can apply this to the Artist tag underneath the track titles?

Here's what it looks like after I replace <Album Artist> with <Artist>:

Code
$Replace($RxReplace(<Artist>,"(.*);( .*)","$1 &$2"),;,",")


As you can see the first few artists still have the semicolon but then the last few are in the proper <artists>, <artist> & <artist> style. They even repeat after the featured artists. Any way to fix that?

Much appreciated!

Edit:

This happens also when the Album Artist & Artist are the same. The Artists still appear under the song title:



Usually there aren't artists listed under the song title when the album artist & artist are the same.
Last Edit: March 01, 2024, 08:21:46 PM by REVOFEV

REVOFEV

  • Newbie
  • *
  • Posts: 6
Interesting thing I found. The code with <Artist> works in the Progress Bar and displays as intended, but in the tracklist under the song title it's not displaying correctly:


REVOFEV

  • Newbie
  • *
  • Posts: 6
Alright, found my answer!

Thanks to this thread (good ol search engine!... honestly have no idea how I stumbled onto this thread but it was through a Google search  ;D )

https://getmusicbee.com/forum/index.php?topic=35476.0

Got everything set up the way I want now.  :-*

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
Glad you all sorted REVOFEV.

(I can see what you did here Mayibongwe, so maybe I can use this as an example to learn a little more about RegEx)
Sweet. A quick breakdown of the regex for everyone:

Search string:              (.*);( .*)
Replacement string:   $1 &$2

(.*);            the period represents "any character" and the asterisk means keep on matching as many "any characters" as you can up until the last semi-colon encountered.
                  the parentheses are just telling it to capture everything in memory except the semi-colon.

( .*)            the second pair of parentheses is telling it to capture the whitespace after the semi-colon and everything else that follows.
                  I should have used \s in the pattern to represent the whitespace for visibility's sake.
                  so (\s.*) would have meant the same thing - whitespace + all that remains.

$1 &$2     dollar one outputs what was captured in the first set of parentheses.
                  dollar two outputs the second captured content.

More in-depth explanations and examples will be found here on karbock's excellent guide.
Strength and Honour (2025)