[WS] Last.fm

Hi Dano,

sorry, first I wrote in german. Now in english again.

Is it possible to add the script with the two tags "Mood" and "Occasion" from Last.fm. I use the script from user "h4de5" and it works. But I would like to add this two tags. Can you help me?

Would be nice. :slight_smile:

Best regards

AFAIK these "tags" are just themed lists of regular tags. The program checks if a certain tag is present and then adds it for example as Mood tag.
They are not actual categories.
Do you mean that?

Hi Dano,

I read this post: Mood und Occasion als Tag-Felder im MP3tag-Editor. And the author has listed the examples of "Mood" and "Occasion".

If it's only themed lists and you can add it as "Mood" or "Occasion" tag, it would be perfect. :slight_smile:

Best regards

Hi Dano,

I've found this post: [WS] Last.fm Genre/Mood with Whitelist. It mentions a - actually not working - last.fm-script, which adds a mood tag. Only a Occasion tag is missing.

Can you update the script with the both new tags from this themed lists of last.fm?

Best regards

We need a separate script for this. I've made this:

Thank you for this script!!!! :slight_smile: :slight_smile: :slight_smile:

If I use e.g. "Bob Marley & The Wailers", it looks like this:
image

When I search the artist: Bob Marley & The Wailers and the song "Three little Birds", the script finds only mood = "mellow". But if I search the song directly on the website last.fm, I find for mood "mellow", "happy" and "feel good". Can you say why the latter two are missing?

The script adds the keywords separated by "\". Is it possible to use the separation ","?

I get 8 mood and 3 occasion values for this song.
If you want a different separator then

replace
(?=</name>)" "\\\\"
with
(?=</name>)" ","

2 times in the script.

Hi Dano,
I use Mp3tag v2.99d. If I search with "Bob Marley & The Wailers" and "Three Little Birds", I get this keyword back:

image

I see in the xml-file via ws.audioscrobbler.com, that the script use the album "Legend".

image

But my tag for "Album" is "Exodus".

Is it possible, that the script use "Album" and "Title" for searching? Or what is my mistake?

Best regards

Small error, try this update:
Last.fm#Track Tags.zip (1.5 KB)

It works!!!!!! Thank you!!!! :slight_smile: :slight_smile: :slight_smile:

Hi @dano ,
I have a problem

image
Sadly not working.

I've checked today and well, the error continues :frowning:

I have tweaked the script and added settings for retrieving top artist genres using the Last.fm API.

Core Functionality

  • The script queries the Last.fm artist.gettoptags API to retrieve artist tags.

  • It maps the returned top tags directly to the Genre field.

  • The script automatically capitalizes the first letter of each tag name returned by Last.fm.

Configurable Settings

The script includes a built-in settings page to adjust the output format:

  • Maximum number of genres: Defines how many top tags to write to the Genre field. Available options are 1, 2, 3, 4, 5, and 10. The default limit is 3.

  • Separator: Defines the characters used to separate multiple genres. Available options are ; , , , /, \\, and |. The default separator is ; .

Let me know if anyone is interested in testing this or integrating it into their workflow.

Script - Last.fm#S - Last.fm Genres.src

#                                โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
#โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค     W E B  S O U R C E    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
#โ”‚                               โ•ฐโ”€โ”€โ”€โ•ฎ   โ€ขโ”€โ”€โ”€โ”€ ๎ฉฆ  โ”€โ”€โ”€โ”€โ€ข  โ•ญโ”€โ”€โ”€โ•ฏ                               โ”‚
#โ”‚        โ€ขโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ€ขโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ€ขโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ€ข  โ”‚    M P 3 T A G    โ”‚  โ€ขโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ€ขโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ€ขโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ€ข        โ”‚
#โ”‚                                   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                                   โ”‚
#โ”‚                                                                                           โ”‚
#โ”‚                     โ–ˆโ–ˆโ•—      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ–ˆโ•—                  โ”‚
#โ”‚                     โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘                  โ”‚
#โ”‚                     โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘                  โ”‚
#โ”‚                     โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘                  โ”‚
#โ”‚                     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘                  โ”‚
#โ”‚                     โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•   โ•šโ•โ•โ•šโ•โ•โ•šโ•โ•     โ•šโ•โ•     โ•šโ•โ•                  โ”‚
#โ”‚                      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—                   โ”‚
#โ”‚                     โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•                   โ”‚
#โ”‚                     โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—                   โ”‚
#โ”‚                     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•  โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘                   โ”‚
#โ”‚                     โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘                   โ”‚
#โ”‚                      โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•                   โ”‚
#โ”‚                                                                                           โ”‚
#โ”‚                            https://github.com/deathrashed/mp3tag                          โ”‚
#โ”‚                                                                                           โ”‚
#โ”‚                 Last.fm artist top tags genre retrieval script for Mp3tag                 โ”‚
#โ”‚    โ€ขโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ€ข    โ”‚
#โ”‚         configurable genre limit โ€ข customizable separators โ€ข unified configuration        โ”‚
#โ”‚                                                                                           โ”‚
#โ”‚                                 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                                โ”‚
#โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค L A S T  U P D A T E D โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
#                                  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โšกโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
#                                        July 18, 2026


# Mp3tag Web Source for Last.fm Top Tag
# Gets Last.fm artist tags as Genre based on settings

[Name]=Last.fm Genres v2
[BasedOn]=www.last.fm
[AlbumUrl]=https://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=%s&api_key=YOUR_API_KEY&format=xml
[WordSeperator]=+
[SearchBy]=$replace(%artist%,/,'%'252F,&,'%'2526)
[Encoding]=url-utf-8
[Settings]=Last.fm#Settingsโ€ฆ.settings

#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
#  ALBUM PARSER
#   - Queries Last.fm artist.gettoptags API and maps top tags to Genre.
#   - Returns: Genre (configurable count and separator)
#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
[ParserScriptAlbum]=...
#debug "on" "debug_lastfm_genres.html"

findline "<?xml"
joinuntil "</lfm>"

# Check valid Last.fm response
findinline "<lfm status=\"ok\">"

#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
#  SEPARATOR INIT
#   - Buffers the chosen separator into a temp variable for reuse between genres.
#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
outputto "_TEMP_SEP"
IfVar "genreSeparator" "; "
	say "; "
EndIf
IfVar "genreSeparator" ", "
	say ", "
EndIf
IfVar "genreSeparator" " / "
	say " / "
EndIf
IfVar "genreSeparator" " \\\\ "
	say " \\\\ "
EndIf
IfVar "genreSeparator" "|"
	say "|"
EndIf

#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
#  CAPITALIZE GENRES
#   - Uppercases the first letter of each tag name returned by Last.fm.
#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
replace "<name>a" "<name>A"
replace "<name>b" "<name>B"
replace "<name>c" "<name>C"
replace "<name>d" "<name>D"
replace "<name>e" "<name>E"
replace "<name>f" "<name>F"
replace "<name>g" "<name>G"
replace "<name>h" "<name>H"
replace "<name>i" "<name>I"
replace "<name>j" "<name>J"
replace "<name>k" "<name>K"
replace "<name>l" "<name>L"
replace "<name>m" "<name>M"
replace "<name>n" "<name>N"
replace "<name>o" "<name>O"
replace "<name>p" "<name>P"
replace "<name>q" "<name>Q"
replace "<name>r" "<name>R"
replace "<name>s" "<name>S"
replace "<name>t" "<name>T"
replace "<name>u" "<name>U"
replace "<name>v" "<name>V"
replace "<name>w" "<name>W"
replace "<name>x" "<name>X"
replace "<name>y" "<name>Y"
replace "<name>z" "<name>Z"
replace " a" " A"
replace " b" " B"
replace " c" " C"
replace " d" " D"
replace " e" " E"
replace " f" " F"
replace " g" " G"
replace " h" " H"
replace " i" " I"
replace " j" " J"
replace " k" " K"
replace " l" " L"
replace " m" " M"
replace " n" " N"
replace " o" " O"
replace " p" " P"
replace " q" " Q"
replace " r" " R"
replace " s" " S"
replace " t" " T"
replace " u" " U"
replace " v" " V"
replace " w" " W"
replace " x" " X"
replace " y" " Y"
replace " z" " Z"

#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
#  GENRE OUTPUT  (limit 1 โ€“ 10, controlled by Settings)
#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
outputto "Genre"
findinline "<name>"
sayuntil "</name>"

# Genre 2
IfVar "genreLimit" "2"
	findinline "</tag>" 1 1
	if "<tag"
		sayoutput "_TEMP_SEP"
		findinline "<name>"
		sayuntil "</name>"
	endif
EndIf

# Genre 3
IfVar "genreLimit" "3"
	findinline "</tag>" 1 1
	if "<tag"
		sayoutput "_TEMP_SEP"
		findinline "<name>"
		sayuntil "</name>"
		findinline "</tag>" 1 1
		if "<tag"
			sayoutput "_TEMP_SEP"
			findinline "<name>"
			sayuntil "</name>"
		endif
	endif
EndIf

# Genre 4
IfVar "genreLimit" "4"
	findinline "</tag>" 1 1
	if "<tag"
		sayoutput "_TEMP_SEP"
		findinline "<name>"
		sayuntil "</name>"
		findinline "</tag>" 1 1
		if "<tag"
			sayoutput "_TEMP_SEP"
			findinline "<name>"
			sayuntil "</name>"
			findinline "</tag>" 1 1
			if "<tag"
				sayoutput "_TEMP_SEP"
				findinline "<name>"
				sayuntil "</name>"
			endif
		endif
	endif
EndIf

# Genre 5
IfVar "genreLimit" "5"
	findinline "</tag>" 1 1
	if "<tag"
		sayoutput "_TEMP_SEP"
		findinline "<name>"
		sayuntil "</name>"
		findinline "</tag>" 1 1
		if "<tag"
			sayoutput "_TEMP_SEP"
			findinline "<name>"
			sayuntil "</name>"
			findinline "</tag>" 1 1
			if "<tag"
				sayoutput "_TEMP_SEP"
				findinline "<name>"
				sayuntil "</name>"
				findinline "</tag>" 1 1
				if "<tag"
					sayoutput "_TEMP_SEP"
					findinline "<name>"
					sayuntil "</name>"
				endif
			endif
		endif
	endif
EndIf

# Genre 10
IfVar "genreLimit" "10"
	do
		findinline "</tag>" 1 1
		if "<tag"
			sayoutput "_TEMP_SEP"
			findinline "<name>"
			sayuntil "</name>"
		endif
	while "<tag" 8
EndIf

#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
#  CLEANUP
#   - Clears temp variables to prevent leakage into other tag fields.
#โ€ขโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ€ข
set "_TEMP_SEP"

Settings - Last.fm#Settingsโ€ฆ.settings

{
  "key": "lastfm",
  "title": "Last.fm Genres Settings",
  "settings": [
    {
      "type": "string",
      "key": "genreLimit",
      "title": "Maximum number of genres",
      "description": "How many Top Tags from Last.fm to write to the Genre field",
      "choices": [
        "1",
        "2",
        "3",
        "4",
        "5",
        "10"
      ],
      "default": "3"
    },
    {
      "type": "string",
      "key": "genreSeparator",
      "title": "Separator",
      "description": "Characters used to separate multiple genres",
      "choices": [
        "; ",
        ", ",
        " / ",
        " \\\\ ",
        "|"
      ],
      "default": "; "
    }
  ]
}