From a7aca6c0abfd905669004c1e4f7c8328060df27e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 19 Sep 2021 10:56:38 +0200 Subject: Improved feed action filters (#3303) * Re-order some feed options * Option to auto mark as read existing titles * Option to keep at max n unread articles per feed --- app/Controllers/subscriptionController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/Controllers/subscriptionController.php') diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index f47988926..4bb08f495 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -112,6 +112,20 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $feed->_attributes('read_upon_reception', Minz_Request::paramTernary('read_upon_reception')); $feed->_attributes('clear_cache', Minz_Request::paramTernary('clear_cache')); + $keep_max_n_unread = intval(Minz_Request::param('keep_max_n_unread', 0)); + $feed->_attributes('keep_max_n_unread', $keep_max_n_unread > 0 ? $keep_max_n_unread : null); + + $read_when_same_title_in_feed = Minz_Request::param('read_when_same_title_in_feed', ''); + if ($read_when_same_title_in_feed === '') { + $read_when_same_title_in_feed = null; + } else { + $read_when_same_title_in_feed = intval($read_when_same_title_in_feed); + if ($read_when_same_title_in_feed <= 0) { + $read_when_same_title_in_feed = false; + } + } + $feed->_attributes('read_when_same_title_in_feed', $read_when_same_title_in_feed); + $cookie = Minz_Request::param('curl_params_cookie', ''); $useragent = Minz_Request::param('curl_params_useragent', ''); $proxy_address = Minz_Request::param('curl_params', ''); -- cgit v1.2.3