Scrobbled tracks CRUD

- Failing tests
- Warnings
This commit is contained in:
Claudio Ortolina
2025-09-03 11:57:56 +03:00
parent 59b00502d3
commit dae334b1b7
18 changed files with 1735 additions and 17 deletions
+1
View File
@@ -15,5 +15,6 @@ defmodule LastFm.Album do
def changeset(album, attrs) do
album
|> cast(attrs, [:musicbrainz_id, :title])
|> validate_required([:title])
end
end
+1
View File
@@ -50,6 +50,7 @@ defmodule LastFm.Artist do
:on_tour,
:base_url
])
|> validate_required([:name])
end
def events_url(artist) do
+3 -3
View File
@@ -29,8 +29,8 @@ defmodule LastFm.Track do
field :cover_url, :string
field :scrobbled_at_label, :string
embeds_one :artist, Artist
embeds_one :album, Album
embeds_one :artist, Artist, on_replace: :update
embeds_one :album, Album, on_replace: :update
field :last_fm_data, :map, default: %{}
end
@@ -89,6 +89,6 @@ defmodule LastFm.Track do
])
|> cast_embed(:artist)
|> cast_embed(:album)
|> validate_required([:scrobbled_at_uts])
|> validate_required([:scrobbled_at_uts, :title])
end
end