aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-12-26 18:26:25 -0600
committerJP Dillingham <jp@dillingham.me>2025-12-26 18:26:25 -0600
commit92bbb7c7e856a9084f6838e36f3e8ff7fb677022 (patch)
tree09dc72a92699a11f23f2d36f3824b6b944e1628e /src
parent936d7ccb67481780b700b230f38e91d357093c76 (diff)
downloadslskd-92bbb7c7e856a9084f6838e36f3e8ff7fb677022.tar.gz
only remove completed transfers
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs9
-rw-r--r--src/slskd/Transfers/Uploads/UploadService.cs9
2 files changed, 10 insertions, 8 deletions
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);
/// <summary>
- /// Removes the download matching the specified <paramref name="id"/>.
+ /// Removes the completed download matching the specified <paramref name="id"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="id">The unique identifier of the download.</param>
@@ -102,7 +102,7 @@ namespace slskd.Transfers.Downloads
bool Remove(Guid id);
/// <summary>
- /// Removes all downloads matching the specified <paramref name="expression"/>.
+ /// Removes all completed downloads matching the specified <paramref name="expression"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="expression">The expression used to match downloads.</param>
@@ -716,7 +716,7 @@ namespace slskd.Transfers.Downloads
}
/// <summary>
- /// Removes the download matching the specified <paramref name="id"/>.
+ /// Removes the completed download matching the specified <paramref name="id"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="id">The unique identifier of the download.</param>
@@ -727,7 +727,7 @@ namespace slskd.Transfers.Downloads
}
/// <summary>
- /// Removes all downloads matching the specified <paramref name="expression"/>.
+ /// Removes all completed downloads matching the specified <paramref name="expression"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="expression">The expression used to match downloads.</param>
@@ -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);
/// <summary>
- /// Removes the upload matching the specified <paramref name="id"/>.
+ /// Removes the completed upload matching the specified <paramref name="id"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="id">The unique identifier of the upload.</param>
@@ -120,7 +120,7 @@ namespace slskd.Transfers.Uploads
bool Remove(Guid id);
/// <summary>
- /// Removes all uploads matching the specified <paramref name="expression"/>.
+ /// Removes all completed uploads matching the specified <paramref name="expression"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="expression">The expression used to match uploads.</param>
@@ -828,7 +828,7 @@ namespace slskd.Transfers.Uploads
}
/// <summary>
- /// Removes the upload matching the specified <paramref name="id"/>.
+ /// Removes the completed upload matching the specified <paramref name="id"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="id">The unique identifier of the upload.</param>
@@ -839,7 +839,7 @@ namespace slskd.Transfers.Uploads
}
/// <summary>
- /// Removes all uploads matching the specified <paramref name="expression"/>.
+ /// Removes all completed uploads matching the specified <paramref name="expression"/>.
/// </summary>
/// <remarks>This is a soft delete; the record is retained for historical retrieval.</remarks>
/// <param name="expression">The expression used to match uploads.</param>
@@ -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));