Recalculate record embedding after their artist changes

This commit is contained in:
Claudio Ortolina
2026-02-15 20:16:34 +00:00
parent 49723c97b0
commit d19f2062c5
@@ -6,7 +6,15 @@ defmodule MusicLibrary.Worker.FetchArtistInfo do
with {:ok, _artist_info} <- MusicLibrary.Artists.fetch_artist_info(artist_id),
{:ok, _artist_info} <- MusicLibrary.Artists.fetch_wikipedia_data(artist_id),
{:ok, _artist_info} <- MusicLibrary.Artists.fetch_image(artist_id) do
:ok
regenerate_record_embeddings(artist_id)
end
end
defp regenerate_record_embeddings(artist_id) do
artist_id
|> MusicLibrary.Records.get_artist_records()
|> Enum.each(fn record ->
MusicLibrary.Records.generate_embedding_async(record)
end)
end
end