From 0b2e019e0d1fd5522afcf2e795427af822447482 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 23 Sep 2025 18:58:29 -0500 Subject: tweak duplicate check --- src/slskd/Transfers/Uploads/UploadService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') 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,10 +518,19 @@ 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 -- cgit v1.2.3