diff options
Diffstat (limited to 'application/front/controller/visitor/BookmarkListController.php')
-rw-r--r-- | application/front/controller/visitor/BookmarkListController.php | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/application/front/controller/visitor/BookmarkListController.php b/application/front/controller/visitor/BookmarkListController.php index a8019ead..5267c8f5 100644 --- a/application/front/controller/visitor/BookmarkListController.php +++ b/application/front/controller/visitor/BookmarkListController.php | |||
@@ -169,16 +169,24 @@ class BookmarkListController extends ShaarliVisitorController | |||
169 | */ | 169 | */ |
170 | protected function updateThumbnail(Bookmark $bookmark, bool $writeDatastore = true): bool | 170 | protected function updateThumbnail(Bookmark $bookmark, bool $writeDatastore = true): bool |
171 | { | 171 | { |
172 | // Logged in, not async retrieval, thumbnails enabled, and thumbnail should be updated | 172 | if (false === $this->container->loginManager->isLoggedIn()) { |
173 | if ($this->container->loginManager->isLoggedIn() | 173 | return false; |
174 | && true !== $this->container->conf->get('general.enable_async_metadata', true) | 174 | } |
175 | && $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE | 175 | |
176 | && $bookmark->shouldUpdateThumbnail() | 176 | // If thumbnail should be updated, we reset it to null |
177 | ) { | 177 | if ($bookmark->shouldUpdateThumbnail()) { |
178 | $bookmark->setThumbnail($this->container->thumbnailer->get($bookmark->getUrl())); | 178 | $bookmark->setThumbnail(null); |
179 | $this->container->bookmarkService->set($bookmark, $writeDatastore); | 179 | |
180 | 180 | // Requires an update, not async retrieval, thumbnails enabled | |
181 | return true; | 181 | if ($bookmark->shouldUpdateThumbnail() |
182 | && true !== $this->container->conf->get('general.enable_async_metadata', true) | ||
183 | && $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE | ||
184 | ) { | ||
185 | $bookmark->setThumbnail($this->container->thumbnailer->get($bookmark->getUrl())); | ||
186 | $this->container->bookmarkService->set($bookmark, $writeDatastore); | ||
187 | |||
188 | return true; | ||
189 | } | ||
182 | } | 190 | } |
183 | 191 | ||
184 | return false; | 192 | return false; |