aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-03-28 09:41:49 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2016-03-28 09:41:49 +0200
commitcc8c2d315f6868201ff32cc4895844c800624a87 (patch)
tree9a59669aba09a08751aecc0dcf8ccd1e20aef6c6 /src/Wallabag/ImportBundle/Import/WallabagV2Import.php
parenta2d6f6e9d806c727b20a08f37ef7ede1e0dad3cf (diff)
parent8f336fda649c064cabfa692793334067ece780f9 (diff)
downloadwallabag-cc8c2d315f6868201ff32cc4895844c800624a87.tar.gz
wallabag-cc8c2d315f6868201ff32cc4895844c800624a87.tar.zst
wallabag-cc8c2d315f6868201ff32cc4895844c800624a87.zip
Merge pull request #1819 from wallabag/cleanup
Some cleanup
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