Show record status when scanning

For now it only imports new records - it should also purchase wishlisted
ones.
This commit is contained in:
Claudio Ortolina
2025-02-19 10:21:44 +00:00
parent 5ef05a94f5
commit ce75b42d06
3 changed files with 118 additions and 67 deletions
+12
View File
@@ -98,6 +98,18 @@ defmodule MusicLibrary.Records do
def get_record!(id), do: Repo.get!(Record, id)
def get_release_status(release_id, format) do
q =
from r in fragment("records, json_each(records.release_ids)"),
where: fragment("records.format = ?", ^format) and r.value == ^release_id,
select: %{
record_id: fragment("records.id"),
purchased_at: fragment("records.purchased_at")
}
Repo.one(q)
end
def get_artist_records(musicbrainz_id) do
q =
from r in Record,