1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

default previews fix when files set on external storage

This commit is contained in:
Damodar Lohani 2022-03-01 11:37:51 +00:00
parent 05ae5019a6
commit a8f316110d

View file

@ -864,7 +864,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
->inject('usage')
->inject('mode')
->inject('deviceFiles')
->action(function ($bucketId, $fileId, $width, $height, $gravity, $quality, $borderWidth, $borderColor, $borderRadius, $opacity, $rotation, $background, $output, $request, $response, $project, $dbForProject, $usage, $mode, $deviceFiles) {
->inject('deviceLocal')
->action(function ($bucketId, $fileId, $width, $height, $gravity, $quality, $borderWidth, $borderColor, $borderRadius, $opacity, $rotation, $background, $output, $request, $response, $project, $dbForProject, $usage, $mode, $deviceFiles, $deviceLocal) {
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Document $project */
@ -935,6 +936,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$background = (empty($background)) ? 'eceff1' : $background;
$type = \strtolower(\pathinfo($path, PATHINFO_EXTENSION));
$key = \md5($path . $width . $height . $gravity . $quality . $borderWidth . $borderColor . $borderRadius . $opacity . $rotation . $background . $output);
$deviceFiles = $deviceLocal;
}