Fix Artists.exists?/1 to account for multiple records

This commit is contained in:
Claudio Ortolina
2025-05-13 10:22:09 +01:00
parent 354c0d8dfb
commit 157b408341
+5 -1
View File
@@ -46,7 +46,11 @@ defmodule MusicLibrary.Artists do
end
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
def delete_artist_info(artist_id) do