aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Import')
-rw-r--r--src/Wallabag/ImportBundle/Import/BrowserImport.php2
-rw-r--r--src/Wallabag/ImportBundle/Import/InstapaperImport.php5
-rw-r--r--src/Wallabag/ImportBundle/Import/PinboardImport.php2
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php2
-rw-r--r--src/Wallabag/ImportBundle/Import/ReadabilityImport.php2
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagImport.php2
6 files changed, 7 insertions, 8 deletions
diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php
index 811e3fb8..3987e80f 100644
--- a/src/Wallabag/ImportBundle/Import/BrowserImport.php
+++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php
@@ -133,7 +133,7 @@ abstract class BrowserImport extends AbstractImport
133 ); 133 );
134 } 134 }
135 135
136 $entry->setArchived($data['is_archived']); 136 $entry->updateArchived($data['is_archived']);
137 137
138 if (!empty($data['created_at'])) { 138 if (!empty($data['created_at'])) {
139 $dt = new \DateTime(); 139 $dt = new \DateTime();
diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php
index 5a18c7c0..439c978c 100644
--- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php
+++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php
@@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport
62 } 62 }
63 63
64 $entries = []; 64 $entries = [];
65 $handle = fopen($this->filepath, 'rb'); 65 $handle = fopen($this->filepath, 'r');
66 while (false !== ($data = fgetcsv($handle, 10240))) { 66 while (false !== ($data = fgetcsv($handle, 10240))) {
67 if ('URL' === $data[0]) { 67 if ('URL' === $data[0]) {
68 continue; 68 continue;
@@ -79,7 +79,6 @@ class InstapaperImport extends AbstractImport
79 $entries[] = [ 79 $entries[] = [
80 'url' => $data[0], 80 'url' => $data[0],
81 'title' => $data[1], 81 'title' => $data[1],
82 'status' => $data[3],
83 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3], 82 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3],
84 'is_starred' => 'Starred' === $data[3], 83 'is_starred' => 'Starred' === $data[3],
85 'html' => false, 84 'html' => false,
@@ -147,7 +146,7 @@ class InstapaperImport extends AbstractImport
147 ); 146 );
148 } 147 }
149 148
150 $entry->setArchived($importedEntry['is_archived']); 149 $entry->updateArchived($importedEntry['is_archived']);
151 $entry->setStarred($importedEntry['is_starred']); 150 $entry->setStarred($importedEntry['is_starred']);
152 151
153 $this->em->persist($entry); 152 $this->em->persist($entry);
diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php
index 995d1f2c..202eb1b3 100644
--- a/src/Wallabag/ImportBundle/Import/PinboardImport.php
+++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php
@@ -131,7 +131,7 @@ class PinboardImport extends AbstractImport
131 ); 131 );
132 } 132 }
133 133
134 $entry->setArchived($data['is_archived']); 134 $entry->updateArchived($data['is_archived']);
135 $entry->setStarred($data['is_starred']); 135 $entry->setStarred($data['is_starred']);
136 $entry->setCreatedAt(new \DateTime($data['created_at'])); 136 $entry->setCreatedAt(new \DateTime($data['created_at']));
137 137
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 5737928d..a39d8156 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -206,7 +206,7 @@ class PocketImport extends AbstractImport
206 $this->fetchContent($entry, $url); 206 $this->fetchContent($entry, $url);
207 207
208 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted 208 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
209 $entry->setArchived(1 === (int) $importedEntry['status'] || $this->markAsRead); 209 $entry->updateArchived(1 === (int) $importedEntry['status'] || $this->markAsRead);
210 210
211 // 0 or 1 - 1 if the item is starred 211 // 0 or 1 - 1 if the item is starred
212 $entry->setStarred(1 === (int) $importedEntry['favorite']); 212 $entry->setStarred(1 === (int) $importedEntry['favorite']);
diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php
index a5f3798e..c5abf189 100644
--- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php
+++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php
@@ -123,7 +123,7 @@ class ReadabilityImport extends AbstractImport
123 // update entry with content (in case fetching failed, the given entry will be return) 123 // update entry with content (in case fetching failed, the given entry will be return)
124 $this->fetchContent($entry, $data['url'], $data); 124 $this->fetchContent($entry, $data['url'], $data);
125 125
126 $entry->setArchived($data['is_archived']); 126 $entry->updateArchived($data['is_archived']);
127 $entry->setStarred($data['is_starred']); 127 $entry->setStarred($data['is_starred']);
128 $entry->setCreatedAt(new \DateTime($data['created_at'])); 128 $entry->setCreatedAt(new \DateTime($data['created_at']));
129 129
diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php
index 58b6a970..75a28fbf 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagImport.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php
@@ -134,7 +134,7 @@ abstract class WallabagImport extends AbstractImport
134 $entry->setPreviewPicture($importedEntry['preview_picture']); 134 $entry->setPreviewPicture($importedEntry['preview_picture']);
135 } 135 }
136 136
137 $entry->setArchived($data['is_archived']); 137 $entry->updateArchived($data['is_archived']);
138 $entry->setStarred($data['is_starred']); 138 $entry->setStarred($data['is_starred']);
139 139
140 if (!empty($data['created_at'])) { 140 if (!empty($data['created_at'])) {