From d60f0b0e74278db9d30b50e40533d92d92c079ec Mon Sep 17 00:00:00 2001 From: Dag Date: Tue, 18 Jun 2024 21:12:29 +0200 Subject: [PATCH] feat(FilterBridge): custom feed name parameter (#4136) fix #4100 --- bridges/FilterBridge.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bridges/FilterBridge.php b/bridges/FilterBridge.php index 3448a8c7..a1066fb5 100644 --- a/bridges/FilterBridge.php +++ b/bridges/FilterBridge.php @@ -15,6 +15,12 @@ class FilterBridge extends FeedExpander 'exampleValue' => 'https://lorem-rss.herokuapp.com/feed?unit=day', 'required' => true, ], + 'name' => [ + 'name' => 'Feed name (optional)', + 'type' => 'text', + 'exampleValue' => 'My feed', + 'required' => false, + ], 'filter' => [ 'name' => 'Filter (regular expression!!!)', 'required' => false, @@ -158,11 +164,18 @@ class FilterBridge extends FeedExpander public function getURI() { $url = $this->getInput('url'); - - if (empty($url)) { - $url = parent::getURI(); + if ($url) { + return $url; } + return parent::getURI(); + } - return $url; + public function getName() + { + $name = $this->getInput('name'); + if ($name) { + return $name; + } + return parent::getName(); } }