From 75042fc5d5d065f187605e33e8b1182d761bbc57 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 21 Oct 2024 22:10:08 +0200 Subject: [PATCH] [backend/drive] Fix drive file cleanup job for locally stored files --- Iceshrimp.Backend/Core/Services/DriveService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Iceshrimp.Backend/Core/Services/DriveService.cs b/Iceshrimp.Backend/Core/Services/DriveService.cs index 85a6e6d4..09374bf0 100644 --- a/Iceshrimp.Backend/Core/Services/DriveService.cs +++ b/Iceshrimp.Backend/Core/Services/DriveService.cs @@ -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");