aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagV2Import.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV2Import.php32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
index 0a32864e..b31d63a3 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
@@ -47,25 +47,29 @@ class WallabagV2Import extends WallabagV1Import implements ImportInterface
47 continue; 47 continue;
48 } 48 }
49 49
50 // @see ContentProxy->updateEntry 50 $importedEntry['html'] = $importedEntry['content'];
51 $entry = new Entry($this->user); 51 $importedEntry['content_type'] = $importedEntry['mimetype'];
52 $entry->setUrl($importedEntry['url']); 52
53 $entry->setTitle($importedEntry['title']); 53 $entry = $this->contentProxy->updateEntry(
54 $entry->setArchived($importedEntry['is_archived'] || $this->markAsRead); 54 new Entry($this->user),
55 $entry->setStarred($importedEntry['is_starred']); 55 $importedEntry['url'],
56 $entry->setContent($importedEntry['content']); 56 $importedEntry
57 $entry->setReadingTime($importedEntry['reading_time']); 57 );
58 $entry->setDomainName($importedEntry['domain_name']); 58
59 if (isset($importedEntry['mimetype'])) { 59 if (array_key_exists('tags', $importedEntry) && !empty($importedEntry['tags'])) {
60 $entry->setMimetype($importedEntry['mimetype']); 60 $this->contentProxy->assignTagsToEntry(
61 } 61 $entry,
62 if (isset($importedEntry['language'])) { 62 $importedEntry['tags']
63 $entry->setLanguage($importedEntry['language']); 63 );
64 } 64 }
65
65 if (isset($importedEntry['preview_picture'])) { 66 if (isset($importedEntry['preview_picture'])) {
66 $entry->setPreviewPicture($importedEntry['preview_picture']); 67 $entry->setPreviewPicture($importedEntry['preview_picture']);
67 } 68 }
68 69
70 $entry->setArchived($importedEntry['is_archived'] || $this->markAsRead);
71 $entry->setStarred($importedEntry['is_starred']);
72
69 $this->em->persist($entry); 73 $this->em->persist($entry);
70 ++$this->importedEntries; 74 ++$this->importedEntries;
71 75