Indicate if stats are incomplete

This commit is contained in:
Cadence Ember 2025-04-15 12:03:20 +12:00
parent c1791f8520
commit f149156def
2 changed files with 27 additions and 18 deletions

View file

@ -58,7 +58,9 @@ pugSync.beforeInclude("includes/collection-stats.pug", async (from, event, {acco
router.get("/:account/collection-stats", defineEventHandler(async event => {
const {account} = await getValidatedRouterParams(event, schema.schema.account.parse)
return pugSync.render(event, "collection-stats.pug", {account, isStatsPage: true})
// if there are any untagged items then we don't have full track data
const hasFullTrackData = !db.prepare("SELECT * FROM item LEFT JOIN item_tag USING (account, item_id) WHERE account = ? AND tag IS NULL").get(account)
return pugSync.render(event, "collection-stats.pug", {account, hasFullTrackData, isStatsPage: true})
}))
router.post("/api/settings/currency", defineEventHandler(async event => {