diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-09-10 21:57:25 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-09-10 21:57:25 +0200 |
commit | 558d9aabab7e01c2e2b506aa362c70a568b953aa (patch) | |
tree | e3fd1fee2ab5f8104edff10dc1d16b86146f9dba /src/Wallabag/CoreBundle/Controller | |
parent | 75c3478a0c308c96bccd871f3bc1343356aafb6b (diff) | |
download | wallabag-558d9aabab7e01c2e2b506aa362c70a568b953aa.tar.gz wallabag-558d9aabab7e01c2e2b506aa362c70a568b953aa.tar.zst wallabag-558d9aabab7e01c2e2b506aa362c70a568b953aa.zip |
Move fetching content in a separate class
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index e6580a57..b9e4e67e 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -30,15 +30,7 @@ class EntryController extends Controller | |||
30 | $form->handleRequest($request); | 30 | $form->handleRequest($request); |
31 | 31 | ||
32 | if ($form->isValid()) { | 32 | if ($form->isValid()) { |
33 | $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl()); | 33 | $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl()); |
34 | |||
35 | $entry->setUrl($content['url'] ?: $entry->getUrl()); | ||
36 | $entry->setTitle($content['title']); | ||
37 | $entry->setContent($content['html']); | ||
38 | $entry->setMimetype($content['content_type']); | ||
39 | if (isset($content['open_graph']['og_image'])) { | ||
40 | $entry->setPreviewPicture($content['open_graph']['og_image']); | ||
41 | } | ||
42 | 34 | ||
43 | $em = $this->getDoctrine()->getManager(); | 35 | $em = $this->getDoctrine()->getManager(); |
44 | $em->persist($entry); | 36 | $em->persist($entry); |