mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Move readingTime & domainName in ContentProxy
So, everything is centralized in one place when we save a new entry.
This commit is contained in:
parent
34c2cc7a1a
commit
da3d4998c0
4 changed files with 25 additions and 7 deletions
|
@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Helper;
|
|||
|
||||
use Graby\Graby;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Tools\Utils;
|
||||
|
||||
/**
|
||||
* This kind of proxy class take care of getting the content from an url
|
||||
|
@ -51,6 +52,8 @@ class ContentProxy
|
|||
$entry->setContent($html);
|
||||
$entry->setLanguage($content['language']);
|
||||
$entry->setMimetype($content['content_type']);
|
||||
$entry->setReadingTime(Utils::getReadingTime($html));
|
||||
$entry->setDomainName(parse_url($entry->getUrl(), PHP_URL_HOST));
|
||||
|
||||
if (isset($content['open_graph']['og_image'])) {
|
||||
$entry->setPreviewPicture($content['open_graph']['og_image']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue