aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-01-07 18:40:56 -0600
committerJP Dillingham <jp@dillingham.me>2024-01-07 18:40:56 -0600
commitf41badad5074668ac36f07a58bbf971e01678ce6 (patch)
tree67903c8d752a45206e57859930ee4721c523b4a2 /src
parent65777f07088b8241e13b25cc56ea3719d5104ccd (diff)
downloadslskd-f41badad5074668ac36f07a58bbf971e01678ce6.tar.gz
make list params more explicit
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Uploads/UploadService.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/slskd/Transfers/Uploads/UploadService.cs b/src/slskd/Transfers/Uploads/UploadService.cs
index 04e6a431..56bf3751 100644
--- a/src/slskd/Transfers/Uploads/UploadService.cs
+++ b/src/slskd/Transfers/Uploads/UploadService.cs
@@ -75,9 +75,9 @@ namespace slskd.Transfers.Uploads
/// Returns a list of all uploads matching the optional <paramref name="expression"/>.
/// </summary>
/// <param name="expression">An optional expression used to match uploads.</param>
- /// <param name="includeRemoved">Optionally include uploads that have been removed previously.</param>
+ /// <param name="includeRemoved">A value indicating whether to include uploads that have been removed previously.</param>
/// <returns>The list of uploads matching the specified expression, or all uploads if no expression is specified.</returns>
- List<Transfer> List(Expression<Func<Transfer, bool>> expression = null, bool includeRemoved = false);
+ List<Transfer> List(Expression<Func<Transfer, bool>> expression, bool includeRemoved);
/// <summary>
/// Removes <see cref="TransferStates.Completed"/> uploads older than the specified <paramref name="age"/>.
@@ -233,7 +233,7 @@ namespace slskd.Transfers.Uploads
Log.Information("Resolved {Remote} to physical file {Physical} on host '{Host}'", filename, localFilename, host);
// find existing records for this username and file that haven't been removed from the UI
- var existingRecords = List(t => t.Username == username && t.Filename == localFilename && !t.Removed);
+ var existingRecords = List(t => t.Username == username && t.Filename == localFilename, includeRemoved: false);
// check whether any of these records is in a non-complete state and bail out if so
if (existingRecords.Any(t => !t.State.HasFlag(TransferStates.Completed)))
@@ -428,9 +428,9 @@ namespace slskd.Transfers.Uploads
/// Returns a list of all uploads matching the optional <paramref name="expression"/>.
/// </summary>
/// <param name="expression">An optional expression used to match uploads.</param>
- /// <param name="includeRemoved">Optionally include uploads that have been removed previously.</param>
+ /// <param name="includeRemoved">A value indicating whether to include uploads that have been removed previously.</param>
/// <returns>The list of uploads matching the specified expression, or all uploads if no expression is specified.</returns>
- public List<Transfer> List(Expression<Func<Transfer, bool>> expression = null, bool includeRemoved = false)
+ public List<Transfer> List(Expression<Func<Transfer, bool>> expression, bool includeRemoved)
{
expression ??= t => true;