X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FWallabagV1Import.php;h=173a587f1cd6ea4c472f6ce78ff4112e50da493b;hb=439b36323e37f669b056cc5228c44bb91196256c;hp=05bdb4014239bc1535619e0aa1f76fd016ce11aa;hpb=c2656f96d4776c86b13d8a4c93a78ee7c4d3824c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 05bdb401..173a587f 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -19,6 +19,7 @@ class WallabagV1Import implements ImportInterface protected $skippedEntries = 0; protected $importedEntries = 0; protected $filepath; + protected $markAsRead; public function __construct(EntityManager $em, ContentProxy $contentProxy) { @@ -66,7 +67,7 @@ class WallabagV1Import implements ImportInterface */ public function getDescription() { - return 'This importer will import all your wallabag v1 articles. On your config page, click on "JSON export" in the "Export your wallabag data" section. You will have a "wallabag-export-1-xxxx-xx-xx.json" file.'; + return 'import.wallabag_v1.description'; } /** @@ -120,6 +121,18 @@ class WallabagV1Import implements ImportInterface return $this; } + /** + * Set whether articles must be all marked as read. + * + * @param bool $markAsRead + */ + public function setMarkAsRead($markAsRead) + { + $this->markAsRead = $markAsRead; + + return $this; + } + /** * @param $entries */ @@ -160,7 +173,7 @@ class WallabagV1Import implements ImportInterface ); } - $entry->setArchived($importedEntry['is_read']); + $entry->setArchived($importedEntry['is_read'] || $this->markAsRead); $entry->setStarred($importedEntry['is_fav']); $this->em->persist($entry);