Improve error handling for color extraction

Includes a around embedding generation, which was happening twice (the
first call was redundant as record embeddings are always regenerated
after their parent artist embeddings are regenerated).

Closes #144.
This commit is contained in:
Claudio Ortolina
2026-03-30 14:29:04 +01:00
parent 24f061646e
commit b0018db89d
5 changed files with 37 additions and 6 deletions
+7
View File
@@ -51,6 +51,13 @@ defmodule MusicLibrary.RecordsTest do
assert Enum.all?(record.dominant_colors, &color_hex?/1)
end
@tag :capture_log
test "succeeds when color extraction fails" do
record = record(dominant_colors: [], cover_hash: "nonexistent_hash")
assert record.dominant_colors == []
end
test "queues a task to retrieve artist info data" do
record =
record(musicbrainz_data: release_group(:lockdown_trilogy))