Export artist names from albums with several different artists

Hi guys, Some albums have a number of different artists and the number of artists is more than one. For albums in which different artists have participated and the number of artists is several, is there a export configurations that can mention the names of all the artists in the html output?
For example, in the artist section, the names of all the artists of an album should be listed without being duplicates ???

For example, according to the image below, the names of each artist should be mentioned in the artist section without repetition and they should be separated by a comma.

2021-10-30_201231

Use $puts and $get to create a variable holding a string of all the artists on an album.
https://help.mp3tag.de/main_scripting.html#variable

Use $loop(%artist%,1) to eliminate duplicates.
https://help.mp3tag.de/options_export.html#syntax

Like this:

$loop(%album%,1)$loop(%artist%,1)$puts(AllArtists,$get(AllArtists)',' %artist%)$loopend()$puts(AllArtists,$cutLeft($get(AllArtists),2))
%album%
$get(AllArtists)$puts(AllArtists,)$loopend()
1 Like

Here is a thread that could have been found with "export artist comma":

1 Like

Thank you dear friend, I will review these cases and if there is a question I will ask here

Thank you dear friend, I will review these cases and if there is a question I will ask here.

The names of all the artists are returned using the following code, thanks to all the friends

This snippet of code returns the names of all the artists on an album, can it be stipulated that if the number of artists is more than 5, they return a specific word like " Various Artists" instead of the names of all the artists?

For example, if the number of artists is more than 5, display the phrase "Various Artists" instead of the full list of artist names

Artist: Various Artists

<td align="right">Artist:</td>

<td align="left">
$loop(%ALBUM%)$puts(ListOfArtists,)
$loop(%ARTIST%)
$loop(%ALBUM%)$puts(ListOfArtists,$get(ListOfArtists)%ARTIST%', ')
$loopend()
$loopend()
$loop(%ALBUM%)$puts(ListOfArtists,$trim($regexp($get(ListOfArtists),'(?:(?<=,)|(?<=\A)|(?<=^))\s?([^,]*),(?=.*?(?<=,)\s?\1(?=,|\Z|$))(?#remove dups from comma- or comma+space- delimited list)',),', '))
$loopend()
$loop(%ALBUM%,1)
  $get(ListOfArtists)
$loopend()
$loopend()
</td>

One way to count the number of artists is to write a list with a unique separator between each artist and then use the length of the resulting string and the length of the same string when the separator is removed by replacing it with nothing.
So if we use { to separate artists when creating ListOfArtists, the following code creates a variable called NumberOfArtists:
$puts(NumberOfArtists,$add($sub($len($get(ListOfArtists)),$len($replace($get(ListOfArtists),{,))),1))

Then this code will write the artist list as you want:
$if($grtr($get(NumberOfArtists),5),Various Artists,$replace($get(ListOfArtists),{,',' ))

I'm not sure of the final product you want but your existing code produces many blank lines that seem unnecessary.
Every line of code in the MTE file creates one line in the exported result.

And I'm puzzled by your use of regex since I provided a simpler alternative.
There is no need to use regex to remove duplicate artists if you use $loop(%artist%,1)

Anyhow, here's my solution:

$loop(%album%,1)$loop(%artist%,1)$puts(ListOfArtists,$get(ListOfArtists){%artist%)$loopend()$puts(ListOfArtists,$cutLeft($get(ListOfArtists),1))

ALBUM: %album%
ARTIST: $puts(NumberOfArtists,$add($sub($len($get(ListOfArtists)),$len($replace($get(ListOfArtists),{,))),1))$if($grtr($get(NumberOfArtists),5),Various Artists,$replace($get(ListOfArtists),{,',' ))$puts(ListOfArtists,)$loopend()
1 Like

Thank you dear friend for spending your valuable time, this snippet code solved my problem :pray: :pray: :pray:

1 Like