Fix collection stats query
Only include latest prices so the card count and value totals are reported correctly.
This commit is contained in:
parent
6fefc74506
commit
6ef889fc06
1 changed files with 2 additions and 0 deletions
|
@ -373,6 +373,8 @@ async def collection_stats(db: psycopg.Cursor) -> dict:
|
||||||
FROM "copies"
|
FROM "copies"
|
||||||
JOIN "cards" USING ("scryfall_id")
|
JOIN "cards" USING ("scryfall_id")
|
||||||
LEFT JOIN "card_prices" USING ("scryfall_id")
|
LEFT JOIN "card_prices" USING ("scryfall_id")
|
||||||
|
WHERE "card_prices"."date" =
|
||||||
|
(SELECT "value" FROM "vars" where "key" = 'last_update')
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
return await db.fetchone()
|
return await db.fetchone()
|
||||||
|
|
Loading…
Reference in a new issue