$data = json_decode(file_get_contents($this->filepath), true);
if (empty($data) || empty($data['bookmarks'])) {
+ $this->logger->error('ReadabilityImport: no entries in imported file');
+
return false;
}
$data = [
'title' => $importedEntry['article__title'],
'url' => $importedEntry['article__url'],
- 'content_type' => '',
- 'language' => '',
'is_archived' => $importedEntry['archive'] || $this->markAsRead,
'is_starred' => $importedEntry['favorite'],
'created_at' => $importedEntry['date_added'],
+ 'html' => false,
];
- $entry = $this->fetchContent(
- new Entry($this->user),
- $data['url'],
- $data
- );
-
- // jump to next entry in case of problem while getting content
- if (false === $entry) {
- ++$this->skippedEntries;
+ $entry = new Entry($this->user);
+ $entry->setUrl($data['url']);
+ $entry->setTitle($data['title']);
- return;
- }
+ // update entry with content (in case fetching failed, the given entry will be return)
+ $this->fetchContent($entry, $data['url'], $data);
- $entry->setArchived($data['is_archived']);
+ $entry->updateArchived($data['is_archived']);
$entry->setStarred($data['is_starred']);
$entry->setCreatedAt(new \DateTime($data['created_at']));