X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FImportBundle%2FImport%2FFirefoxImport.php;h=c18e7e93e64e42679cbf66567b72b1a3a80064f4;hb=f808b01692a835673f328d7221ba8c212caa9b61;hp=cbf10b87c0401a3b8b8a9d1a6b92c78713b6a3ab;hpb=59201088b4fc13fd361238396f630dabd9bd1990;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index cbf10b87..c18e7e93 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -2,13 +2,6 @@ namespace Wallabag\ImportBundle\Import; -use Psr\Log\LoggerInterface; -use Psr\Log\NullLogger; -use Doctrine\ORM\EntityManager; -use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\UserBundle\Entity\User; -use Wallabag\CoreBundle\Helper\ContentProxy; - class FirefoxImport extends BrowserImport { protected $filepath; @@ -40,32 +33,22 @@ class FirefoxImport extends BrowserImport /** * {@inheritdoc} */ - protected function prepareEntry($entry = []) - { - $data = [ - 'title' => $entry['name'], - 'html' => '', - 'url' => $entry['url'], - 'is_archived' => $this->markAsRead, - 'tags' => '', - 'created_at' => $entry['date_added'], - ]; - - if (array_key_exists('tags', $entry) && $entry['tags'] != '') { - $data['tags'] = $entry['tags']; - } - - return $data; - } - - - /** - * {@inheritdoc} - */ - protected function setEntryAsRead(array $importedEntry) + protected function prepareEntry(array $entry = []) { - $importedEntry['is_archived'] = 1; - - return $importedEntry; + $data = [ + 'title' => $entry['title'], + 'html' => false, + 'url' => $entry['uri'], + 'is_archived' => (int) $this->markAsRead, + 'is_starred' => false, + 'tags' => '', + 'created_at' => substr($entry['dateAdded'], 0, 10), + ]; + + if (array_key_exists('tags', $entry) && $entry['tags'] !== '') { + $data['tags'] = $entry['tags']; + } + + return $data; } }