Board: Auto-Update fix, gelber Punkt für Ersteller, Poll 30s

This commit is contained in:
2026-05-28 18:53:12 +02:00
parent b66a373764
commit cc6a1c6dc7
2 changed files with 10 additions and 14 deletions

View File

@@ -147,8 +147,8 @@ router.get('/board/unread', authenticate, (req, res) => {
? db.prepare("SELECT COUNT(*) c FROM board_items WHERE created_at > ? AND user_id != ?").get(lastRead, u).c
: db.prepare('SELECT COUNT(*) c FROM board_items WHERE user_id != ?').get(u).c;
const unreadPromoted = lastRead
? db.prepare("SELECT COUNT(*) c FROM board_items WHERE promoted_at > ? AND user_id != ?").get(lastRead, u).c
: db.prepare("SELECT COUNT(*) c FROM board_items WHERE promoted_at IS NOT NULL AND user_id != ?").get(u).c;
? db.prepare("SELECT COUNT(*) c FROM board_items WHERE promoted_at > ?").get(lastRead).c
: db.prepare("SELECT COUNT(*) c FROM board_items WHERE promoted_at IS NOT NULL").get().c;
res.json({ unread, unreadPromoted });
});