Use embedded schemas for LastFm track, artist and album
Preparation for persisting the scrobble activity to database
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user