mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update image pipeline, use config_cache
This commit is contained in:
parent
ad506e901d
commit
a72188a7db
6 changed files with 12 additions and 8 deletions
|
@ -45,7 +45,7 @@ class ImageOptimize implements ShouldQueue
|
|||
return;
|
||||
}
|
||||
|
||||
if(config('pixelfed.optimize_image') == false) {
|
||||
if((bool) config_cache('pixelfed.optimize_image') == false) {
|
||||
ImageThumbnail::dispatch($media)->onQueue('mmo');
|
||||
return;
|
||||
} else {
|
||||
|
|
|
@ -51,7 +51,7 @@ class ImageResize implements ShouldQueue
|
|||
return;
|
||||
}
|
||||
|
||||
if(!config('pixelfed.optimize_image')) {
|
||||
if((bool) config_cache('pixelfed.optimize_image') === false) {
|
||||
ImageThumbnail::dispatch($media)->onQueue('mmo');
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class ImageUpdate implements ShouldQueue
|
|||
return;
|
||||
}
|
||||
|
||||
if(config('pixelfed.optimize_image')) {
|
||||
if((bool) config_cache('pixelfed.optimize_image')) {
|
||||
if (in_array($media->mime, $this->protectedMimes) == true) {
|
||||
ImageOptimizer::optimize($thumb);
|
||||
if(!$media->skip_optimize) {
|
||||
|
|
|
@ -98,6 +98,10 @@ class ConfigCacheService
|
|||
'captcha.triggers.login.enabled',
|
||||
'captcha.triggers.login.attempts',
|
||||
'federation.custom_emoji.enabled',
|
||||
|
||||
'pixelfed.optimize_image',
|
||||
'pixelfed.optimize_video',
|
||||
'pixelfed.max_collection_length',
|
||||
// 'system.user_mode'
|
||||
];
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@ class Config
|
|||
'album_limit' => (int) config_cache('pixelfed.max_album_length'),
|
||||
'image_quality' => (int) config_cache('pixelfed.image_quality'),
|
||||
|
||||
'max_collection_length' => (int) config('pixelfed.max_collection_length', 18),
|
||||
'max_collection_length' => (int) config_cache('pixelfed.max_collection_length', 18),
|
||||
|
||||
'optimize_image' => (bool) config('pixelfed.optimize_image'),
|
||||
'optimize_video' => (bool) config('pixelfed.optimize_video'),
|
||||
'optimize_image' => (bool) config_cache('pixelfed.optimize_image'),
|
||||
'optimize_video' => (bool) config_cache('pixelfed.optimize_video'),
|
||||
|
||||
'media_types' => config_cache('pixelfed.media_types'),
|
||||
'mime_types' => config_cache('pixelfed.media_types') ? explode(',', config_cache('pixelfed.media_types')) : [],
|
||||
|
|
|
@ -750,12 +750,12 @@
|
|||
<tr>
|
||||
<td><span class="badge badge-primary">PIXELFED</span></td>
|
||||
<td><strong>PF_OPTIMIZE_IMAGES</strong></td>
|
||||
<td><span>{{config_cache('pixelfed.optimize_image') ? '✅ true' : '❌ false' }}</span></td>
|
||||
<td><span>{{(bool) config_cache('pixelfed.optimize_image') ? '✅ true' : '❌ false' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="badge badge-primary">PIXELFED</span></td>
|
||||
<td><strong>PF_OPTIMIZE_VIDEOS</strong></td>
|
||||
<td><span>{{config_cache('pixelfed.optimize_video') ? '✅ true' : '❌ false' }}</span></td>
|
||||
<td><span>{{(bool) config_cache('pixelfed.optimize_video') ? '✅ true' : '❌ false' }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="badge badge-primary">PIXELFED</span></td>
|
||||
|
|
Loading…
Reference in a new issue