diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagV2Import.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/WallabagV2Import.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php index d0035b63..faf4236f 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php | |||
@@ -31,12 +31,28 @@ class WallabagV2Import extends WallabagImport | |||
31 | /** | 31 | /** |
32 | * {@inheritdoc} | 32 | * {@inheritdoc} |
33 | */ | 33 | */ |
34 | protected function prepareEntry($entry = [], $markAsRead = false) | 34 | protected function prepareEntry($entry = []) |
35 | { | 35 | { |
36 | return [ | 36 | return [ |
37 | 'html' => $entry['content'], | 37 | 'html' => $entry['content'], |
38 | 'content_type' => $entry['mimetype'], | 38 | 'content_type' => $entry['mimetype'], |
39 | 'is_archived' => ($entry['is_archived'] || $markAsRead), | 39 | 'is_archived' => ($entry['is_archived'] || $this->markAsRead), |
40 | ] + $entry; | 40 | ] + $entry; |
41 | } | 41 | } |
42 | |||
43 | protected function parseEntriesForProducer($entries) | ||
44 | { | ||
45 | foreach ($entries as $importedEntry) { | ||
46 | // set userId for the producer (it won't know which user is connected) | ||
47 | $importedEntry['userId'] = $this->user->getId(); | ||
48 | |||
49 | if ($this->markAsRead) { | ||
50 | $importedEntry['is_archived'] = 1; | ||
51 | } | ||
52 | |||
53 | ++$this->importedEntries; | ||
54 | |||
55 | $this->producer->publish(json_encode($importedEntry)); | ||
56 | } | ||
57 | } | ||
42 | } | 58 | } |