From 509c8cae6381ec46af7c8303eb92fda6ce496a4a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 4 Jul 2022 09:53:26 +0200 Subject: Dynamic OPML (#4407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Dynamic OPML draft #fix https://github.com/FreshRSS/FreshRSS/issues/4191 * Export dynamic OPML http://opml.org/spec2.opml#1629043127000 * Restart with simpler approach * Minor revert * Export dynamic OPML also for single feeds * Special category type for importing dynamic OPML * Parameter for excludeMutedFeeds * Details * More draft * i18n * Fix update * Draft manual import working * Working manual refresh * Draft automatic update * Working Web refresh + fixes * Import/export dynamic OPML settings * Annoying numerous lines in SQL logs * Fix minor JavaScript error * Fix auto adding new columns * Add require * Add missing 🗲 * Missing space * Disable adding new feeds to dynamic categories * Link from import * i18n typo * Improve theme icon function * Fix pink-dark --- app/Controllers/feedController.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'app/Controllers/feedController.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index fe5641642..8621cb535 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -67,6 +67,10 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { $cat_id = $cat == null ? FreshRSS_CategoryDAO::DEFAULTCATEGORYID : $cat->id(); $feed = new FreshRSS_Feed($url); //Throws FreshRSS_BadUrl_Exception + $title = trim($title); + if ($title != '') { + $feed->_name($title); + } $feed->_kind($kind); $feed->_attributes('', $attributes); $feed->_httpAuth($http_auth); @@ -92,19 +96,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { throw new FreshRSS_FeedNotAdded_Exception($url); } - $values = array( - 'url' => $feed->url(), - 'kind' => $feed->kind(), - 'category' => $feed->category(), - 'name' => $title != '' ? $title : $feed->name(true), - 'website' => $feed->website(), - 'description' => $feed->description(), - 'lastUpdate' => 0, - 'httpAuth' => $feed->httpAuth(), - 'attributes' => $feed->attributes(), - ); - - $id = $feedDAO->addFeed($values); + $id = $feedDAO->addFeedObject($feed); if (!$id) { // There was an error in database… we cannot say what here. throw new FreshRSS_FeedNotAdded_Exception($url); @@ -469,7 +461,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { } if ($pubSubHubbubEnabled && !$simplePiePush) { //We use push, but have discovered an article by pull! - $text = 'An article was discovered by pull although we use PubSubHubbub!: Feed ' . $url . + $text = 'An article was discovered by pull although we use PubSubHubbub!: Feed ' . + SimplePie_Misc::url_remove_credentials($url) . ' GUID ' . $entry->guid(); Minz_Log::warning($text, PSHB_LOG); Minz_Log::warning($text); @@ -528,7 +521,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { } } } elseif ($feed->url() !== $url) { // HTTP 301 Moved Permanently - Minz_Log::notice('Feed ' . $url . ' moved permanently to ' . $feed->url(false)); + Minz_Log::notice('Feed ' . SimplePie_Misc::url_remove_credentials($url) . + ' moved permanently to ' . SimplePie_Misc::url_remove_credentials($feed->url(false))); $feedProperties['url'] = $feed->url(); } @@ -629,6 +623,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { $databaseDAO = FreshRSS_Factory::createDatabaseDAO(); $databaseDAO->minorDbMaintenance(); } else { + FreshRSS_category_Controller::refreshDynamicOpmls(); list($updated_feeds, $feed, $nb_new_articles) = self::actualizeFeed($id, $url, $force, null, $noCommit, $maxFeeds); } -- cgit v1.2.3