👔 File controller now return now when client request thumbnail but file has not
This commit is contained in:
@@ -67,9 +67,16 @@ public class FileController(
|
|||||||
|
|
||||||
var fileName = string.IsNullOrWhiteSpace(file.StorageId) ? file.Id : file.StorageId;
|
var fileName = string.IsNullOrWhiteSpace(file.StorageId) ? file.Id : file.StorageId;
|
||||||
|
|
||||||
if (thumbnail && file.HasThumbnail)
|
switch (thumbnail)
|
||||||
fileName += ".thumbnail";
|
{
|
||||||
else if (!original && file.HasCompression)
|
case true when file.HasThumbnail:
|
||||||
|
fileName += ".thumbnail";
|
||||||
|
break;
|
||||||
|
case true when !file.HasThumbnail:
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!original && file.HasCompression)
|
||||||
fileName += ".compressed";
|
fileName += ".compressed";
|
||||||
|
|
||||||
if (dest.ImageProxy is not null && (file.MimeType?.StartsWith("image/") ?? false))
|
if (dest.ImageProxy is not null && (file.MimeType?.StartsWith("image/") ?? false))
|
||||||
|
Reference in New Issue
Block a user