Show country flag for artist
This commit is contained in:
@@ -6,4 +6,11 @@ defmodule Discogs.Fixtures.Artist do
|
||||
|> File.read!()
|
||||
|> JSON.decode!()
|
||||
end
|
||||
|
||||
def image_data do
|
||||
Path.join([@fixtures_folder, "steven wilson.jpeg"])
|
||||
|> File.read!()
|
||||
end
|
||||
|
||||
def image_width, do: 225
|
||||
end
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
@@ -75,6 +75,21 @@ defmodule MusicLibrary.Fixtures.Records do
|
||||
record
|
||||
end
|
||||
|
||||
def artist_info(musicbrainz_id, attrs \\ %{}) do
|
||||
{:ok, artist_info} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
id: musicbrainz_id,
|
||||
musicbrainz_data: MusicBrainz.Fixtures.Artist.get_artist(),
|
||||
discogs_data: Discogs.Fixtures.Artist.get_artist(),
|
||||
image_data: Discogs.Fixtures.Artist.image_data(),
|
||||
image_width: Discogs.Fixtures.Artist.image_width()
|
||||
})
|
||||
|> MusicLibrary.Artists.create_artist_info()
|
||||
|
||||
artist_info
|
||||
end
|
||||
|
||||
def record_with_artist(artist_name, record_attrs \\ %{}) do
|
||||
record_attrs
|
||||
|> Map.put(:artists, [artist_attrs(artist_name)])
|
||||
|
||||
Reference in New Issue
Block a user