Scrobbled tracks CRUD
- Failing tests - Warnings
This commit is contained in:
@@ -15,5 +15,6 @@ defmodule LastFm.Album do
|
||||
def changeset(album, attrs) do
|
||||
album
|
||||
|> cast(attrs, [:musicbrainz_id, :title])
|
||||
|> validate_required([:title])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,6 +50,7 @@ defmodule LastFm.Artist do
|
||||
:on_tour,
|
||||
:base_url
|
||||
])
|
||||
|> validate_required([:name])
|
||||
end
|
||||
|
||||
def events_url(artist) do
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user