diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/PocketImport.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/PocketImport.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 19b63f17..798cfdae 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php | |||
@@ -2,7 +2,6 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Import; | 3 | namespace Wallabag\ImportBundle\Import; |
4 | 4 | ||
5 | use Psr\Log\LoggerInterface; | ||
6 | use Psr\Log\NullLogger; | 5 | use Psr\Log\NullLogger; |
7 | use Doctrine\ORM\EntityManager; | 6 | use Doctrine\ORM\EntityManager; |
8 | use GuzzleHttp\Client; | 7 | use GuzzleHttp\Client; |
@@ -12,12 +11,9 @@ use Wallabag\CoreBundle\Entity\Entry; | |||
12 | use Wallabag\CoreBundle\Helper\ContentProxy; | 11 | use Wallabag\CoreBundle\Helper\ContentProxy; |
13 | use Craue\ConfigBundle\Util\Config; | 12 | use Craue\ConfigBundle\Util\Config; |
14 | 13 | ||
15 | class PocketImport implements ImportInterface | 14 | class PocketImport extends AbstractImport |
16 | { | 15 | { |
17 | private $user; | 16 | private $user; |
18 | private $em; | ||
19 | private $contentProxy; | ||
20 | private $logger; | ||
21 | private $client; | 17 | private $client; |
22 | private $consumerKey; | 18 | private $consumerKey; |
23 | private $skippedEntries = 0; | 19 | private $skippedEntries = 0; |
@@ -34,11 +30,6 @@ class PocketImport implements ImportInterface | |||
34 | $this->logger = new NullLogger(); | 30 | $this->logger = new NullLogger(); |
35 | } | 31 | } |
36 | 32 | ||
37 | public function setLogger(LoggerInterface $logger) | ||
38 | { | ||
39 | $this->logger = $logger; | ||
40 | } | ||
41 | |||
42 | /** | 33 | /** |
43 | * {@inheritdoc} | 34 | * {@inheritdoc} |
44 | */ | 35 | */ |
@@ -219,7 +210,13 @@ class PocketImport implements ImportInterface | |||
219 | } | 210 | } |
220 | 211 | ||
221 | $entry = new Entry($this->user); | 212 | $entry = new Entry($this->user); |
222 | $entry = $this->contentProxy->updateEntry($entry, $url); | 213 | $entry = $this->fetchContent($entry, $url); |
214 | |||
215 | // jump to next entry in case of problem while getting content | ||
216 | if (false === $entry) { | ||
217 | ++$this->skippedEntries; | ||
218 | continue; | ||
219 | } | ||
223 | 220 | ||
224 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted | 221 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted |
225 | if ($pocketEntry['status'] == 1 || $this->markAsRead) { | 222 | if ($pocketEntry['status'] == 1 || $this->markAsRead) { |