X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FChromeImport.php;h=e3ba636a0c3688a75ca44ae414a5b45e7f680ed7;hb=f808b01692a835673f328d7221ba8c212caa9b61;hp=7936ee2f427d862ab9df3f2f1d2994739814fa59;hpb=59201088b4fc13fd361238396f630dabd9bd1990;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index 7936ee2f..e3ba636a 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.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 ChromeImport extends BrowserImport { protected $filepath; @@ -37,35 +30,25 @@ class ChromeImport extends BrowserImport return 'import.chrome.description'; } - /** - * {@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['name'], + 'html' => false, + 'url' => $entry['url'], + 'is_archived' => (int) $this->markAsRead, + 'is_starred' => false, + 'tags' => '', + 'created_at' => substr($entry['date_added'], 0, 10), + ]; + + if (array_key_exists('tags', $entry) && $entry['tags'] !== '') { + $data['tags'] = $entry['tags']; + } + + return $data; } }