aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Uploads/UploadService.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/slskd/Transfers/Uploads/UploadService.cs b/src/slskd/Transfers/Uploads/UploadService.cs
index 84152b59..5e0db336 100644
--- a/src/slskd/Transfers/Uploads/UploadService.cs
+++ b/src/slskd/Transfers/Uploads/UploadService.cs
@@ -518,11 +518,20 @@ namespace slskd.Transfers.Uploads
*/
if (existingInProgressRecords.Count != 0)
{
- Log.Information("Upload of {Filename} to {Username} is already queued or is in progress (ids: {Ids})", filename, username, string.Join(", ", existingInProgressRecords));
+ Log.Information("Upload of {Filename} to {Username} is already queued or is in progress (ids: {Ids})", filename, username, string.Join(", ", existingInProgressRecords.Select(t => t.Id)));
return null;
}
/*
+ check the tracked upload dictionary in Soulseek.NET to see if it knows about this already
+ it shouldn't, if the slskd database doesn't. but things could get desynced
+ */
+ if (Client.Uploads.Any(u => u.Username == username && u.Filename == filename))
+ {
+ throw new DuplicateTransferException("A duplicate upload of the same file to the same user is already registered");
+ }
+
+ /*
no existing transfers. next, check to see if they are requesting a file we are sharing
we do this after checking the database because database I/O is "cheaper" than disk and potentially