diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-09-11 20:17:42 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-09-11 20:17:42 +0200 |
commit | 9c08a891f9bb90bc3f23a575a734283c1ee00ba1 (patch) | |
tree | f5e90765bdd2b923cbd008722e12be25028bdf6d /src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |
parent | 49e564ec159371d9fa751ba75f9f1c555d108179 (diff) | |
parent | f1e29e69cb0ba5a0f05190c62e7a4afd43d03436 (diff) | |
download | wallabag-9c08a891f9bb90bc3f23a575a734283c1ee00ba1.tar.gz wallabag-9c08a891f9bb90bc3f23a575a734283c1ee00ba1.tar.zst wallabag-9c08a891f9bb90bc3f23a575a734283c1ee00ba1.zip |
Merge pull request #1397 from wallabag/v2-graby
Integrate graby
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/WallabagRestController.php')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 02a6de64..349229f3 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -8,7 +8,6 @@ use Symfony\Component\HttpFoundation\Request; | |||
8 | use Symfony\Component\HttpFoundation\Response; | 8 | use Symfony\Component\HttpFoundation\Response; |
9 | use Wallabag\CoreBundle\Entity\Entry; | 9 | use Wallabag\CoreBundle\Entity\Entry; |
10 | use Wallabag\CoreBundle\Entity\Tag; | 10 | use Wallabag\CoreBundle\Entity\Tag; |
11 | use Wallabag\CoreBundle\Service\Extractor; | ||
12 | use Hateoas\Configuration\Route; | 11 | use Hateoas\Configuration\Route; |
13 | use Hateoas\Representation\Factory\PagerfantaFactory; | 12 | use Hateoas\Representation\Factory\PagerfantaFactory; |
14 | 13 | ||
@@ -147,11 +146,10 @@ class WallabagRestController extends Controller | |||
147 | { | 146 | { |
148 | $url = $request->request->get('url'); | 147 | $url = $request->request->get('url'); |
149 | 148 | ||
150 | $content = Extractor::extract($url); | 149 | $entry = $this->get('wallabag_core.content_proxy')->updateEntry( |
151 | $entry = new Entry($this->getUser()); | 150 | new Entry($this->getUser()), |
152 | $entry->setUrl($url); | 151 | $url |
153 | $entry->setTitle($request->request->get('title') ?: $content->getTitle()); | 152 | ); |
154 | $entry->setContent($content->getBody()); | ||
155 | 153 | ||
156 | $tags = $request->request->get('tags', ''); | 154 | $tags = $request->request->get('tags', ''); |
157 | if (!empty($tags)) { | 155 | if (!empty($tags)) { |