Add status for each track in the scrobble activity

This commit is contained in:
Claudio Ortolina
2024-11-13 11:53:45 +00:00
parent a0947b07f3
commit 80f945555c
5 changed files with 79 additions and 6 deletions
+10
View File
@@ -46,6 +46,16 @@ defmodule MusicLibrary.Collection do
Repo.one!(q)
end
def collected_release_ids(release_ids) do
q =
from r in fragment("records, json_each(records.release_ids)"),
where: r.value in ^release_ids,
where: fragment("records.purchased_at IS NOT NULL"),
select: r.value
Repo.all(q)
end
defp base_search do
from r in Record,
where: not is_nil(r.purchased_at)