diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-27 23:32:55 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-27 23:58:37 +0200 |
commit | 8f336fda649c064cabfa692793334067ece780f9 (patch) | |
tree | 62702d9c78391031f810bdc78475d04c5f6807c0 /src/Wallabag/ImportBundle/Import | |
parent | 4d0ec0e72108ff47952906e5d968a7c3eb0a76f9 (diff) | |
download | wallabag-8f336fda649c064cabfa692793334067ece780f9.tar.gz wallabag-8f336fda649c064cabfa692793334067ece780f9.tar.zst wallabag-8f336fda649c064cabfa692793334067ece780f9.zip |
Tags were not imported in wallabag v2 import
Also, simplify exportAs matching format
Diffstat (limited to 'src/Wallabag/ImportBundle/Import')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/WallabagV2Import.php | 32 |
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 | ||