diff options
| author | 2022-08-08 12:04:02 +0200 | |
|---|---|---|
| committer | 2022-08-08 12:04:02 +0200 | |
| commit | 82ac1d1e676f93b1567eba608c00c6edaf401a9e (patch) | |
| tree | 1b3609df25f3eb1892aa7d359f52b82d680830a7 /app/Controllers/feedController.php | |
| parent | 240afa7d4dcf33de4575a1531e2db3c9f4400c1f (diff) | |
Refactor entry-to-GReader API format (#4490)
* Refactor entry to GReader API format
Some code was copied in two locations and not completely uniform.
Cleaning of related variables and functions (e.g. better types for entries and categories as objects vs. as IDs).
Usecase: I need to call the same GReader-compatible serialization from an extension
* Fixed some edge cases
* Keep summary instead of content
`summary` and `content` seems to be used interchangeably in the Google Reader API. We have been using `summary` for our client API and `content` in our export/import, so stick to that.
Diffstat (limited to 'app/Controllers/feedController.php')
| -rwxr-xr-x | app/Controllers/feedController.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 0699844d8..31875fa56 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -74,7 +74,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { $feed->_kind($kind); $feed->_attributes('', $attributes); $feed->_httpAuth($http_auth); - $feed->_category($cat_id); + $feed->_categoryId($cat_id); switch ($kind) { case FreshRSS_Feed::KIND_RSS: case FreshRSS_Feed::KIND_RSS_FORCED: @@ -425,6 +425,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { //Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->url(false) . //', old hash ' . $existingHash . ', new hash ' . $entry->hash()); $entry->_isRead($mark_updated_article_unread ? false : null); //Change is_read according to policy. + $entry->_isFavorite(null); // Do not change favourite state /** @var FreshRSS_Entry|null */ $entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry); @@ -908,7 +909,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { } //Get feed. - $feed = $entry->feed(true); + $feed = $entry->feed(); if (!$feed) { $this->view->fatalError = _t('feedback.sub.feed.selector_preview.no_feed'); |
