Fix Artists.exists?/1 to account for multiple records
This commit is contained in:
@@ -46,7 +46,11 @@ defmodule MusicLibrary.Artists do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def exists?(artist_id) do
|
def exists?(artist_id) do
|
||||||
Repo.get_by(ArtistRecord, musicbrainz_id: artist_id) !== nil
|
q =
|
||||||
|
from ar in ArtistRecord,
|
||||||
|
where: ar.musicbrainz_id == ^artist_id
|
||||||
|
|
||||||
|
Repo.exists?(q)
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_artist_info(artist_id) do
|
def delete_artist_info(artist_id) do
|
||||||
|
|||||||
Reference in New Issue
Block a user