From 34532c0dd49f825ca4f265db9dec446ec0ecd34f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 30 Sep 2025 10:05:17 +0200 Subject: Add new visibility priority *Show in its feed* (#7972) * Add new visibility priority *Show in its feed* fix https://github.com/FreshRSS/FreshRSS/pull/7970#issuecomment-3293917428 (you can't directly filter a hidden feed, it just shows a 404 page) And add a new visibility *Show in its feed* to show the feed in the list but not its articles. Ensure that visibility *hidden* is not shown to API. * TODO for later * Update app/i18n/pl/sub.php Co-authored-by: Inverle --- p/api/fever.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'p/api/fever.php') diff --git a/p/api/fever.php b/p/api/fever.php index 01e6d7b61..420a17f64 100644 --- a/p/api/fever.php +++ b/p/api/fever.php @@ -317,6 +317,9 @@ final class FeverAPI /** @var FreshRSS_Feed $feed */ foreach ($myFeeds as $feed) { + if ($feed->priority() <= FreshRSS_Feed::PRIORITY_HIDDEN) { + continue; + } $feeds[] = [ 'id' => $feed->id(), 'favicon_id' => $feed->id(), @@ -362,6 +365,9 @@ final class FeverAPI $myFeeds = $this->feedDAO->listFeeds(); foreach ($myFeeds as $feed) { + if ($feed->priority() <= FreshRSS_Feed::PRIORITY_HIDDEN) { + continue; + } $id = $feed->hashFavicon(); $filename = DATA_PATH . '/favicons/' . $id . '.ico'; if (!file_exists($filename)) { @@ -390,6 +396,9 @@ final class FeverAPI $myFeeds = $this->feedDAO->listFeeds(); foreach ($myFeeds as $feed) { + if ($feed->priority() <= FreshRSS_Feed::PRIORITY_HIDDEN) { + continue; + } $ids[$feed->categoryId()][] = $feed->id(); } @@ -471,10 +480,13 @@ final class FeverAPI $feeds = []; foreach ($group_ids as $id) { $category = $categoryDAO->searchById((int)$id); //TODO: Transform to SQL query without loop! Consider FreshRSS_CategoryDAO::listCategories(true) - if ($category == null) { + if ($category === null) { continue; } foreach ($category->feeds() as $feed) { + if ($feed->priority() <= FreshRSS_Feed::PRIORITY_HIDDEN) { + continue; + } $feeds[] = $feed->id(); } } -- cgit v1.2.3