X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FReadabilityImport.php;h=b8c0f777094e8d33a3645d528560df0d19812183;hb=114c55c0a6eade2ba6c53fe25f61cc58cca91620;hp=8f080d382c12fa0d16e9e1f43675545b448bcdc9;hpb=6d65c0a8b089d3caa6f8e20d7935a9fe2f87d926;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 8f080d38..b8c0f777 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php @@ -44,17 +44,6 @@ class ReadabilityImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ - public function getSummary() - { - return [ - 'skipped' => $this->skippedEntries, - 'imported' => $this->importedEntries, - ]; - } - /** * {@inheritdoc} */ @@ -75,6 +64,8 @@ class ReadabilityImport extends AbstractImport $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; } @@ -114,18 +105,12 @@ class ReadabilityImport extends AbstractImport 'created_at' => $importedEntry['date_added'], ]; - $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) + $entry = $this->fetchContent($entry, $data['url'], $data); $entry->setArchived($data['is_archived']); $entry->setStarred($data['is_starred']);