🐛 File service fixes
This commit is contained in:
@@ -172,7 +172,15 @@ public class FileService(
|
|||||||
using var vipsImage = Image.NewFromStream(stream);
|
using var vipsImage = Image.NewFromStream(stream);
|
||||||
var width = vipsImage.Width;
|
var width = vipsImage.Width;
|
||||||
var height = vipsImage.Height;
|
var height = vipsImage.Height;
|
||||||
var orientation = vipsImage.Get("orientation") as int? ?? 1;
|
var orientation = 1;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
orientation = vipsImage.Get("orientation") as int? ?? 1;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
|
||||||
var meta = new Dictionary<string, object?>
|
var meta = new Dictionary<string, object?>
|
||||||
{
|
{
|
||||||
@@ -347,8 +355,9 @@ public class FileService(
|
|||||||
var fileToUpdate = await scopedDb.Files.FirstAsync(f => f.Id == fileId);
|
var fileToUpdate = await scopedDb.Files.FirstAsync(f => f.Id == fileId);
|
||||||
if (hasThumbnail) fileToUpdate.HasThumbnail = true;
|
if (hasThumbnail) fileToUpdate.HasThumbnail = true;
|
||||||
|
|
||||||
|
var now = SystemClock.Instance.GetCurrentInstant();
|
||||||
await scopedDb.Files.Where(f => f.Id == fileId).ExecuteUpdateAsync(setter => setter
|
await scopedDb.Files.Where(f => f.Id == fileId).ExecuteUpdateAsync(setter => setter
|
||||||
.SetProperty(f => f.UploadedAt, Instant.FromDateTimeUtc(DateTime.UtcNow))
|
.SetProperty(f => f.UploadedAt, now)
|
||||||
.SetProperty(f => f.UploadedTo, uploadedTo)
|
.SetProperty(f => f.UploadedTo, uploadedTo)
|
||||||
.SetProperty(f => f.MimeType, newMimeType)
|
.SetProperty(f => f.MimeType, newMimeType)
|
||||||
.SetProperty(f => f.HasCompression, hasCompression)
|
.SetProperty(f => f.HasCompression, hasCompression)
|
||||||
|
Reference in New Issue
Block a user