EXP: enrich artist info data via Last.fm and produce better embeddings

This commit is contained in:
Claudio Ortolina
2026-03-01 08:22:15 +00:00
parent 5d8bf68b64
commit b35f4aed1d
8 changed files with 309 additions and 16 deletions
+17
View File
@@ -57,6 +57,23 @@ defmodule LastFm do
end
end
def get_artist_tags(musicbrainz_id, name) do
last_fm_config = last_fm_config()
case API.get_artist_tags({:musicbrainz_id, musicbrainz_id}, last_fm_config) do
{:ok, tags} ->
{:ok, tags}
{:error, :invalid_parameters} ->
# Sometimes the artist cannot be identified with the MusicBrainz ID,
# because Last.fm doesn't have that information. In that case, we try again with the artist name.
API.get_artist_tags({:name, name}, last_fm_config)
error ->
error
end
end
def get_session(token) do
last_fm_config = last_fm_config()