Use embedded schemas for LastFm track, artist and album

Preparation for persisting the scrobble activity to database
This commit is contained in:
Claudio Ortolina
2025-05-30 17:01:12 +01:00
parent 06511f89db
commit 46ffa375af
3 changed files with 32 additions and 25 deletions
+5 -2
View File
@@ -1,9 +1,12 @@
defmodule LastFm.Album do
@enforce_keys [:musicbrainz_id, :title]
defstruct [:musicbrainz_id, :title]
use Ecto.Schema
@type t :: %__MODULE__{
musicbrainz_id: String.t(),
title: String.t()
}
embedded_schema do
field :musicbrainz_id, :string
field :title, :string
end
end