From 7896e6983f73a1647ed32366d317c9d3264af254 Mon Sep 17 00:00:00 2001 From: x Date: Sat, 24 Jan 2026 19:25:05 +0100 Subject: [PATCH] feat: Filter top tags to only include those assigned to at least one item. --- src/inc/routes/toptags.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/inc/routes/toptags.mjs b/src/inc/routes/toptags.mjs index 9139ae6..983e236 100644 --- a/src/inc/routes/toptags.mjs +++ b/src/inc/routes/toptags.mjs @@ -14,6 +14,7 @@ export default (router, tpl) => { LEFT JOIN tags_assign ta ON t.id = ta.tag_id WHERE t.id not in (${db.unsafe(nsfp)}) GROUP BY t.id, t.tag + HAVING COUNT(DISTINCT ta.item_id) >= 1 ORDER BY total_items DESC ; `; @@ -23,6 +24,7 @@ export default (router, tpl) => { FROM tags t LEFT JOIN tags_assign ta ON t.id = ta.tag_id GROUP BY t.id, t.tag + HAVING COUNT(DISTINCT ta.item_id) >= 1 ORDER BY total_items DESC ; `;