From fe8b37c137adbe036f58616c15dbcffd07dd2cd4 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 12 Feb 2016 15:59:13 +0100 Subject: Mark all imported articles as read --- src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php') diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php index 35fe620f..8b27144b 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php @@ -21,12 +21,14 @@ class WallabagV1Controller 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.'; -- cgit v1.2.3 From 79d0e38e7ff975b2e0306d3dd96f57509fd84aef Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 4 Mar 2016 10:04:51 +0100 Subject: Adding test Reformat json file (thanks pro.jsonlint.com) --- src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php') diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php index 8b27144b..154a0769 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php @@ -32,6 +32,7 @@ class WallabagV1Controller extends Controller ->import(); $message = 'Import failed, please try again.'; + if (true === $res) { $summary = $wallabag->getSummary(); $message = 'Import summary: '.$summary['imported'].' imported, '.$summary['skipped'].' already saved.'; -- cgit v1.2.3