]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Move fetching content in a separate class
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index e6580a579b6821992c6207f078af5991fa548d53..b9e4e67e3b85561e11fdf0aee7316172204a984a 100644 (file)
@@ -30,15 +30,7 @@ class EntryController extends Controller
         $form->handleRequest($request);
 
         if ($form->isValid()) {
-            $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl());
-
-            $entry->setUrl($content['url'] ?: $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);