From 92bbb7c7e856a9084f6838e36f3e8ff7fb677022 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 26 Dec 2025 18:26:25 -0600 Subject: only remove completed transfers --- src/slskd/Transfers/Downloads/DownloadService.cs | 9 +++++---- src/slskd/Transfers/Uploads/UploadService.cs | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index f62af711..f1f39fba 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -94,7 +94,7 @@ namespace slskd.Transfers.Downloads int Prune(int age, params TransferStates[] states); /// - /// Removes the download matching the specified . + /// Removes the completed download matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The unique identifier of the download. @@ -102,7 +102,7 @@ namespace slskd.Transfers.Downloads bool Remove(Guid id); /// - /// Removes all downloads matching the specified . + /// Removes all completed downloads matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The expression used to match downloads. @@ -716,7 +716,7 @@ namespace slskd.Transfers.Downloads } /// - /// Removes the download matching the specified . + /// Removes the completed download matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The unique identifier of the download. @@ -727,7 +727,7 @@ namespace slskd.Transfers.Downloads } /// - /// Removes all downloads matching the specified . + /// Removes all completed downloads matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The expression used to match downloads. @@ -740,6 +740,7 @@ namespace slskd.Transfers.Downloads var count = context.Transfers .Where(t => t.Direction == TransferDirection.Download) + .Where(t => TransferStateCategories.Completed.Contains((int)t.State)) .Where(expression) .ExecuteUpdate(r => r.SetProperty(c => c.Removed, true)); diff --git a/src/slskd/Transfers/Uploads/UploadService.cs b/src/slskd/Transfers/Uploads/UploadService.cs index a30bb87f..d75ccea3 100644 --- a/src/slskd/Transfers/Uploads/UploadService.cs +++ b/src/slskd/Transfers/Uploads/UploadService.cs @@ -112,7 +112,7 @@ namespace slskd.Transfers.Uploads int Prune(int age, params TransferStates[] states); /// - /// Removes the upload matching the specified . + /// Removes the completed upload matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The unique identifier of the upload. @@ -120,7 +120,7 @@ namespace slskd.Transfers.Uploads bool Remove(Guid id); /// - /// Removes all uploads matching the specified . + /// Removes all completed uploads matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The expression used to match uploads. @@ -828,7 +828,7 @@ namespace slskd.Transfers.Uploads } /// - /// Removes the upload matching the specified . + /// Removes the completed upload matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The unique identifier of the upload. @@ -839,7 +839,7 @@ namespace slskd.Transfers.Uploads } /// - /// Removes all uploads matching the specified . + /// Removes all completed uploads matching the specified . /// /// This is a soft delete; the record is retained for historical retrieval. /// The expression used to match uploads. @@ -852,6 +852,7 @@ namespace slskd.Transfers.Uploads var count = context.Transfers .Where(t => t.Direction == TransferDirection.Upload) + .Where(t => TransferStateCategories.Completed.Contains((int)t.State)) .Where(expression) .ExecuteUpdate(r => r.SetProperty(c => c.Removed, true)); -- cgit v1.2.3