diff options
| author | 2022-08-08 12:04:02 +0200 | |
|---|---|---|
| committer | 2022-08-08 12:04:02 +0200 | |
| commit | 82ac1d1e676f93b1567eba608c00c6edaf401a9e (patch) | |
| tree | 1b3609df25f3eb1892aa7d359f52b82d680830a7 /app/Services/ExportService.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/Services/ExportService.php')
| -rw-r--r-- | app/Services/ExportService.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/Services/ExportService.php b/app/Services/ExportService.php index b5630f57f..ad0f5f5a8 100644 --- a/app/Services/ExportService.php +++ b/app/Services/ExportService.php @@ -71,17 +71,17 @@ class FreshRSS_Export_Service { */ public function generateStarredEntries($type) { $view = new FreshRSS_View(); - $view->categories = $this->category_dao->listCategories(); + $view->categories = $this->category_dao->listCategories(true); $day = date('Y-m-d'); $view->list_title = _t('sub.import_export.starred_list'); $view->type = 'starred'; - $view->entriesId = $this->entry_dao->listIdsWhere( + $entriesId = $this->entry_dao->listIdsWhere( $type, '', FreshRSS_Entry::STATE_ALL, 'ASC', -1 ); - $view->entryIdsTagNames = $this->tag_dao->getEntryIdsTagNames($view->entriesId); + $view->entryIdsTagNames = $this->tag_dao->getEntryIdsTagNames($entriesId); // The following is a streamable query, i.e. must be last - $view->entriesRaw = $this->entry_dao->listWhereRaw( + $view->entries = $this->entry_dao->listWhere( $type, '', FreshRSS_Entry::STATE_ALL, 'ASC', -1 ); @@ -107,19 +107,19 @@ class FreshRSS_Export_Service { } $view = new FreshRSS_View(); - $view->categories = $this->category_dao->listCategories(); + $view->categories = $this->category_dao->listCategories(true); $view->feed = $feed; $day = date('Y-m-d'); - $filename = "feed_{$day}_" . $feed->category() . '_' . $feed->id() . '.json'; + $filename = "feed_{$day}_" . $feed->categoryId() . '_' . $feed->id() . '.json'; $view->list_title = _t('sub.import_export.feed_list', $feed->name()); $view->type = 'feed/' . $feed->id(); - $view->entriesId = $this->entry_dao->listIdsWhere( + $entriesId = $this->entry_dao->listIdsWhere( 'f', $feed->id(), FreshRSS_Entry::STATE_ALL, 'ASC', $max_number_entries ); - $view->entryIdsTagNames = $this->tag_dao->getEntryIdsTagNames($view->entriesId); + $view->entryIdsTagNames = $this->tag_dao->getEntryIdsTagNames($entriesId); // The following is a streamable query, i.e. must be last - $view->entriesRaw = $this->entry_dao->listWhereRaw( + $view->entries = $this->entry_dao->listWhere( 'f', $feed->id(), FreshRSS_Entry::STATE_ALL, 'ASC', $max_number_entries ); |
