]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
Mark all imported articles as read
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Controller / WallabagV2Controller.php
index 2e6225f295ec15146e9cdb1c4dc259fd7b37e0d1..6dcd204a7240a6d15f0fc84f035c4a254e663869 100644 (file)
@@ -21,12 +21,14 @@ class WallabagV2Controller extends Controller
 
         if ($form->isValid()) {
             $file = $form->get('file')->getData();
+            $markAsRead = $form->get('mark_as_read')->getData();
             $name = $this->getUser()->getId().'.json';
 
             if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
                 $res = $wallabag
                     ->setUser($this->getUser())
                     ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name)
+                    ->setMarkAsRead($markAsRead)
                     ->import();
 
                 $message = 'Import failed, please try again.';