]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/ContentProxy.php
Added http_status in Entry entity
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / ContentProxy.php
index bbad705fa9bb05561d25cddb93a64b8cc16b92f5..178910abbfc848a87a9888f839d8a593677ace61 100644 (file)
@@ -3,7 +3,7 @@
 namespace Wallabag\CoreBundle\Helper;
 
 use Graby\Graby;
-use Psr\Log\LoggerInterface as Logger;
+use Psr\Log\LoggerInterface;
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\CoreBundle\Entity\Tag;
 use Wallabag\CoreBundle\Tools\Utils;
@@ -20,7 +20,7 @@ class ContentProxy
     protected $logger;
     protected $tagRepository;
 
-    public function __construct(Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, Logger $logger)
+    public function __construct(Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, LoggerInterface $logger)
     {
         $this->graby = $graby;
         $this->tagger = $tagger;
@@ -65,6 +65,8 @@ class ContentProxy
 
         $entry->setUrl($content['url'] ?: $url);
         $entry->setTitle($title);
+        $entry->setContent($html);
+        $entry->setHttpStatus(isset($content['status']) ? $content['status'] : '');
 
         $entry->setLanguage($content['language']);
         $entry->setMimetype($content['content_type']);
@@ -75,14 +77,6 @@ class ContentProxy
             $entry->setDomainName($domainName);
         }
 
-        if (true) {
-            $this->logger->log('debug','Starting to download images');
-            $downloadImages = new DownloadImages($html, $url, $this->logger);
-            $html = $downloadImages->process();
-        }
-
-        $entry->setContent($html);
-
         if (isset($content['open_graph']['og_image'])) {
             $entry->setPreviewPicture($content['open_graph']['og_image']);
         }