1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-26 18:21:02 +00:00

Mark all imported articles as read

This commit is contained in:
Thomas Citharel 2016-02-12 15:59:13 +01:00 committed by Jeremy Benoist
parent 7d12fd0628
commit fe8b37c137
6 changed files with 29 additions and 2 deletions

View 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.';