Fix stats queries not to include wishlist

This commit is contained in:
Claudio Ortolina
2024-10-22 18:27:44 +01:00
parent 8e654fb782
commit 52a268851a
+3
View File
@@ -80,6 +80,7 @@ defmodule MusicLibrary.Records do
def count_records_by_format do
q =
from r in Record,
where: not is_nil(r.purchased_at),
group_by: r.format,
select: {r.format, count(r.id)}
@@ -89,6 +90,7 @@ defmodule MusicLibrary.Records do
def count_records_by_type do
q =
from r in Record,
where: not is_nil(r.purchased_at),
group_by: r.type,
select: {r.type, count(r.id)}
@@ -100,6 +102,7 @@ defmodule MusicLibrary.Records do
def get_latest_record! do
q =
from r in Record,
where: not is_nil(r.purchased_at),
order_by: [desc: r.purchased_at],
limit: 1,
select: ^@fields