From 7c0370b4eacdd62c06c7324a39f092361e84a2bc Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 27 Dec 2025 16:26:02 +0100 Subject: Do not include hidden feeds when counting unread articles in categories (#8357) fix https://github.com/FreshRSS/FreshRSS/issues/8347 --- app/Models/CategoryDAO.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/Models/CategoryDAO.php') diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index e03f69016..d98a2ffc1 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -410,9 +410,14 @@ SQL; return isset($res[0]) ? (int)$res[0] : -1; } - public function countNotRead(int $id): int { - $sql = 'SELECT COUNT(*) AS count FROM `_entry` e INNER JOIN `_feed` f ON e.id_feed=f.id WHERE category=:id AND e.is_read=0'; - $res = $this->fetchColumn($sql, 0, [':id' => $id]); + public function countNotRead(int $id, int $minPriority = FreshRSS_Feed::PRIORITY_CATEGORY): int { + $sql = <<<'SQL' + SELECT COUNT(*) AS count FROM `_entry` e + INNER JOIN `_feed` f ON e.id_feed=f.id + WHERE f.category=:id AND e.is_read=0 + AND f.priority>=:minPriority + SQL; + $res = $this->fetchColumn($sql, 0, [':id' => $id, ':minPriority' => $minPriority]); return isset($res[0]) ? (int)$res[0] : -1; } -- cgit v1.2.3