2016-01-20 13:37:01 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 00:30:12 +00:00
|
|
|
namespace Wallabag\Import;
|
2016-01-20 13:37:01 +00:00
|
|
|
|
2016-03-28 14:43:33 +00:00
|
|
|
class WallabagV2Import extends WallabagImport
|
2016-01-20 13:37:01 +00:00
|
|
|
{
|
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return 'wallabag v2';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getUrl()
|
|
|
|
{
|
|
|
|
return 'import_wallabag_v2';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDescription()
|
|
|
|
{
|
2016-03-09 07:59:08 +00:00
|
|
|
return 'import.wallabag_v2.description';
|
2016-01-20 13:37:01 +00:00
|
|
|
}
|
|
|
|
|
2016-09-04 19:49:21 +00:00
|
|
|
protected function prepareEntry($entry = [])
|
2016-01-20 13:37:01 +00:00
|
|
|
{
|
2016-03-28 14:43:33 +00:00
|
|
|
return [
|
|
|
|
'html' => $entry['content'],
|
2017-11-11 19:04:15 +00:00
|
|
|
'headers' => [
|
|
|
|
'content-type' => $entry['mimetype'],
|
|
|
|
],
|
2017-05-30 18:15:41 +00:00
|
|
|
'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead),
|
|
|
|
'is_starred' => (bool) $entry['is_starred'],
|
2016-03-28 14:43:33 +00:00
|
|
|
] + $entry;
|
2016-01-20 13:37:01 +00:00
|
|
|
}
|
2016-09-04 19:49:21 +00:00
|
|
|
|
2016-09-05 05:50:10 +00:00
|
|
|
protected function setEntryAsRead(array $importedEntry)
|
2016-09-04 19:49:21 +00:00
|
|
|
{
|
2016-09-05 05:50:10 +00:00
|
|
|
$importedEntry['is_archived'] = 1;
|
2016-09-04 19:49:21 +00:00
|
|
|
|
2016-09-05 05:50:10 +00:00
|
|
|
return $importedEntry;
|
2016-09-04 19:49:21 +00:00
|
|
|
}
|
2016-01-20 13:37:01 +00:00
|
|
|
}
|