[backend/drive] Fix drive file cleanup job for locally stored files

This commit is contained in:
Laura Hausmann 2024-10-21 22:10:08 +02:00
parent fd7d3eabb2
commit 75042fc5d5
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -437,7 +437,8 @@ public class DriveService(
{
if (file is not { UserHost: not null, Uri: not null, IsLink: false }) return;
string?[] paths = [file.AccessKey, file.ThumbnailAccessKey, file.PublicAccessKey];
string?[] paths = [file.AccessKey, file.ThumbnailAccessKey, file.PublicAccessKey];
var storedInternal = file.StoredInternal;
file.IsLink = true;
file.Url = file.Uri;
@ -465,7 +466,7 @@ public class DriveService(
return;
}
if (file.StoredInternal)
if (storedInternal)
{
var pathBase = storageConfig.Value.Local?.Path ??
throw new Exception("Cannot delete locally stored file: pathBase is null");