[backend/drive] Correctly set thumbnail & webpublicUrl when using the local storage provider

This commit is contained in:
Laura Hausmann 2024-05-01 01:20:08 +02:00
parent facc7eb337
commit 7976854190
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -246,6 +246,7 @@ public class DriveService(
await using var thumbWriter = File.OpenWrite(thumbPath); await using var thumbWriter = File.OpenWrite(thumbPath);
await thumbnail.CopyToAsync(thumbWriter); await thumbnail.CopyToAsync(thumbWriter);
await thumbnail.DisposeAsync(); await thumbnail.DisposeAsync();
thumbnailUrl = $"https://{instanceConfig.Value.WebDomain}/files/{thumbnailFilename}";
} }
if (webpublicFilename != null && webpublic is { Length: > 0 }) if (webpublicFilename != null && webpublic is { Length: > 0 })
@ -254,6 +255,7 @@ public class DriveService(
await using var webpWriter = File.OpenWrite(webpPath); await using var webpWriter = File.OpenWrite(webpPath);
await webpublic.CopyToAsync(webpWriter); await webpublic.CopyToAsync(webpWriter);
await webpublic.DisposeAsync(); await webpublic.DisposeAsync();
webpublicUrl = $"https://{instanceConfig.Value.WebDomain}/files/{webpublicFilename}";
} }
} }
else else