]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/WallabagV2Import.php
Fix because of some breaking changes of Graby 2.0
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / WallabagV2Import.php
index d0035b63d9326973ae15c6996bc52871bd342d95..2ba26003f784a5a2310a040cc5baf1dc0eecd1b9 100644 (file)
@@ -31,12 +31,25 @@ class WallabagV2Import extends WallabagImport
     /**
      * {@inheritdoc}
      */
-    protected function prepareEntry($entry = [], $markAsRead = false)
+    protected function prepareEntry($entry = [])
     {
         return [
             'html' => $entry['content'],
-            'content_type' => $entry['mimetype'],
-            'is_archived' => ($entry['is_archived'] || $markAsRead),
+            'headers' => [
+                'content-type' => $entry['mimetype'],
+            ],
+            'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead),
+            'is_starred' => (bool) $entry['is_starred'],
         ] + $entry;
     }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function setEntryAsRead(array $importedEntry)
+    {
+        $importedEntry['is_archived'] = 1;
+
+        return $importedEntry;
+    }
 }