From aea9ba0d62b86be05e53747c97bfcbc8f4bc4408 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 21 Oct 2024 13:41:16 +0200 Subject: New option mark article as read if identical title in category (#6922) * New mark articles as read if identical title in category fix https://github.com/FreshRSS/FreshRSS/issues/6143 * i18n todo forgotten --- app/Models/CategoryDAO.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/Models') diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index 2e9892df9..6b563b0a8 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -388,6 +388,20 @@ SQL; return isset($res[0]) ? (int)$res[0] : -1; } + /** @return array */ + public function listTitles(int $id, int $limit = 0): array { + $sql = <<<'SQL' + SELECT e.title FROM `_entry` e + INNER JOIN `_feed` f ON e.id_feed=f.id + WHERE f.category=:id_category + ORDER BY e.id DESC + SQL; + $sql .= ($limit < 1 ? '' : ' LIMIT ' . intval($limit)); + $res = $this->fetchColumn($sql, 0, [':id_category' => $id]) ?? []; + /** @var array $res */ + return $res; + } + /** * @param array