diff options
| author | 2023-12-15 23:04:29 +0100 | |
|---|---|---|
| committer | 2023-12-15 23:04:29 +0100 | |
| commit | 6bb45a87268157aab961a6a4a728d9a9bbe043b0 (patch) | |
| tree | d1c36638d5ee61e2e663d214d724a71f07a89354 /app/Controllers/feedController.php | |
| parent | a3ed8269132303eebc03d3e6df822f1f101fa95b (diff) | |
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
Diffstat (limited to 'app/Controllers/feedController.php')
| -rw-r--r-- | app/Controllers/feedController.php | 13 |
1 files changed, 13 insertions, 0 deletions
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 |
