From 6bb45a87268157aab961a6a4a728d9a9bbe043b0 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 15 Dec 2023 23:04:29 +0100 Subject: Add filter actions (auto mark read) at category and global levels (#5942) * Add filter actions (auto mark read) at category level fix https://github.com/FreshRSS/FreshRSS/issues/3497 * Add filter actions (auto mark read) at global level fix https://github.com/FreshRSS/FreshRSS/issues/2788 * Fix feed category ID * Minor comment --- app/Controllers/feedController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/Controllers/feedController.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index bba5870dd..aec39587e 100644 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -361,6 +361,19 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { } } else { $feeds = $feedDAO->listFeedsOrderUpdate(-1); + + // Hydrate category for each feed to avoid that each feed has to make an SQL request + $categories = []; + $catDAO = FreshRSS_Factory::createCategoryDao(); + foreach ($catDAO->listCategories(false, false) as $category) { + $categories[$category->id()] = $category; + } + foreach ($feeds as $feed) { + $category = $categories[$feed->categoryId()] ?? null; + if ($category !== null) { + $feed->_category($category); + } + } } // WebSub (PubSubHubbub) support -- cgit v1.2.3