X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FInstapaperImport.php;h=439c978c71f02a6d4953cf25e7475b2a9a63582a;hb=2491c50b6bbb4d51696ad64aa754c1cd0fc83d1b;hp=7ab69e7a34ab5cffa9dca765060ff0b62c5f0229;hpb=d8dc7372ab3d8ac4c5d5546e5c5e00bf4bf2d862;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 7ab69e7a..439c978c 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -72,14 +72,13 @@ class InstapaperImport extends AbstractImport // BUT it can also be the status (since status = folder in Instapaper) // and we don't want archive, unread & starred to become a tag $tags = null; - if (false === in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) { + if (false === \in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) { $tags = [$data[3]]; } $entries[] = [ 'url' => $data[0], 'title' => $data[1], - 'status' => $data[3], 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3], 'is_starred' => 'Starred' === $data[3], 'html' => false, @@ -105,6 +104,18 @@ class InstapaperImport extends AbstractImport return true; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ @@ -135,7 +146,7 @@ class InstapaperImport extends AbstractImport ); } - $entry->setArchived($importedEntry['is_archived']); + $entry->updateArchived($importedEntry['is_archived']); $entry->setStarred($importedEntry['is_starred']); $this->em->persist($entry);