From c8bbf355342985c83054c6c36c6538a780ab509e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 29 Jun 2025 11:09:08 +0200 Subject: Add search operator `c:` for categories (#7696) * Add search operator `c:` for categories fix https://github.com/FreshRSS/FreshRSS/discussions/7692 Allow searching for e.g. `c:23,34` --- app/Models/Entry.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/Models/Entry.php') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 66c05a830..190b435c8 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -642,6 +642,12 @@ HTML; if ($ok && $filter->getNotFeedIds() !== null) { $ok &= !in_array($this->feedId, $filter->getNotFeedIds(), true); } + if ($ok && $filter->getCategoryIds() !== null) { + $ok &= in_array($this->feed()?->categoryId(), $filter->getCategoryIds(), true); + } + if ($ok && $filter->getNotCategoryIds() !== null) { + $ok &= !in_array($this->feed()?->categoryId(), $filter->getNotCategoryIds(), true); + } if ($ok && $filter->getAuthor() !== null) { foreach ($filter->getAuthor() as $author) { $ok &= stripos(implode(';', $this->authors), $author) !== false; -- cgit v1.2.3