]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Merge pull request #1397 from wallabag/v2-graby
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index bd87c6f4431ff88a702d58e3cedbdade7c866adb..b9e4e67e3b85561e11fdf0aee7316172204a984a 100644 (file)
@@ -6,7 +6,6 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
 use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\CoreBundle\Service\Extractor;
 use Wallabag\CoreBundle\Form\Type\NewEntryType;
 use Wallabag\CoreBundle\Form\Type\EditEntryType;
 use Wallabag\CoreBundle\Filter\EntryFilterType;
@@ -31,14 +30,7 @@ class EntryController extends Controller
         $form->handleRequest($request);
 
         if ($form->isValid()) {
-            $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl());
-
-            $entry->setTitle($content['title']);
-            $entry->setContent($content['html']);
-            $entry->setMimetype($content['content_type']);
-            if (isset($content['open_graph']['og_image'])) {
-                $entry->setPreviewPicture($content['open_graph']['og_image']);
-            }
+            $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
 
             $em = $this->getDoctrine()->getManager();
             $em->persist($entry);