]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/WallabagV1Import.php
Merge pull request #1712 from wallabag/v2-contributing
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / WallabagV1Import.php
index c54e73b2c8d53dce1616592b289b8668e345c90b..05bdb4014239bc1535619e0aa1f76fd016ce11aa 100644 (file)
@@ -143,6 +143,7 @@ class WallabagV1Import implements ImportInterface
             // @see ContentProxy->updateEntry
             $entry = new Entry($this->user);
             $entry->setUrl($importedEntry['url']);
+
             if (in_array($importedEntry['title'], $untitled)) {
                 $entry = $this->contentProxy->updateEntry($entry, $importedEntry['url']);
             } else {
@@ -151,6 +152,14 @@ class WallabagV1Import implements ImportInterface
                 $entry->setReadingTime(Utils::getReadingTime($importedEntry['content']));
                 $entry->setDomainName(parse_url($importedEntry['url'], PHP_URL_HOST));
             }
+
+            if (array_key_exists('tags', $importedEntry) && $importedEntry['tags'] != '') {
+                $this->contentProxy->assignTagsToEntry(
+                    $entry,
+                    $importedEntry['tags']
+                );
+            }
+
             $entry->setArchived($importedEntry['is_read']);
             $entry->setStarred($importedEntry['is_fav']);