Import artist joinphrase

This commit is contained in:
Claudio Ortolina
2025-06-03 18:16:47 +01:00
parent 669b144c55
commit 27c1cc0eda
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -8,11 +8,12 @@ defmodule MusicLibrary.Artists.Artist do
field :name, :string
field :sort_name, :string
field :disambiguation, :string
field :joinphrase, :string, default: " and "
end
def changeset(artist, attrs) do
artist
|> cast(attrs, [:name, :sort_name, :disambiguation, :musicbrainz_id])
|> cast(attrs, [:name, :sort_name, :disambiguation, :joinphrase, :musicbrainz_id])
|> validate_required([:name, :sort_name, :musicbrainz_id])
end
end
+2 -1
View File
@@ -188,7 +188,8 @@ defmodule MusicLibrary.Records.Record do
name: artist["name"],
musicbrainz_id: artist["id"],
sort_name: artist["sort-name"],
disambiguation: artist["disambiguation"]
disambiguation: artist["disambiguation"],
joinphrase: artist["joinphrase"]
}
end)
@@ -102,7 +102,8 @@ defmodule MusicLibrary.Fixtures.Records do
name: name,
musicbrainz_id: artist_uuid(name),
sort_name: name,
disambiguation: name
disambiguation: name,
joinphrase: " and "
}
end