feat: Filter top tags to only include those assigned to at least one item.

This commit is contained in:
x
2026-01-24 19:25:05 +01:00
parent debb14142e
commit 7896e6983f

View File

@@ -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
;
`;