📌 [HELP] How to show only the first artist in $mi(artist)$?

Hey everyone! I’m working on a music widget in KWGT and I ran into a small issue with artist names.

I’m using the formula $mi(artist)$ to display the current song’s artist, but when there are multiple artists, it shows something like:

The Weeknd;Ariana Grande

What I want is to only show the first artist, so it would be:
→ “The Weeknd”, and ignore the rest.

Is there any way to cut everything after the ; or maybe a workaround to achieve this?

Any help or working formula would be really appreciated :folded_hands:

Thanks in advance!

Hi there,

The easiest way is… edit your track artists to just the first artist.

I hope this would help.
:smiling_face: :+1:

You could use regex:
$tc(reg, mi(artist), ";.*", "")$

; matches a semicolon and .* matches any number of any characters after the semicolon.

1 Like

Hi @Alex1 ,

Here is the not so easy way,

Original:
$mi(artist)$

Trimmed:
$tc(reg,
  mi(artist),
  "^(.+?)([,;&].*)$", "$1"
)$

I hope this would help.
:smiling_face::+1:

1 Like