forked from wallabag/wallabag
Ability to enable/disable downloading images
This will speed up the test suite because it won’t download everything when we add new entry… Add a custom test with downloading image enabled
This commit is contained in:
@ -52,6 +52,10 @@ class DownloadImagesSubscriber implements EventSubscriber
|
||||
$config = new $this->configClass();
|
||||
$config->setEntityManager($args->getEntityManager());
|
||||
|
||||
if (!$config->get('download_images_enabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// field content has been updated
|
||||
if ($args->hasChangedField('content')) {
|
||||
$html = $this->downloadImages($config, $entity);
|
||||
@ -87,6 +91,10 @@ class DownloadImagesSubscriber implements EventSubscriber
|
||||
$config = new $this->configClass();
|
||||
$config->setEntityManager($args->getEntityManager());
|
||||
|
||||
if (!$config->get('download_images_enabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// update all images inside the html
|
||||
$html = $this->downloadImages($config, $entity);
|
||||
if (false !== $html) {
|
||||
|
||||
Reference in New Issue
Block a user