diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-04-24 17:45:08 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-04-24 17:45:08 -0500 |
| commit | 0248581eecad4a9ab6c633ad751ba0ec450660ef (patch) | |
| tree | 77a29357c85b3974038b4bb5824c57d62660cc1e /src | |
| parent | 8fa61f8714af038ba7c5dc7b61449ac8c5aaab24 (diff) | |
| download | slskd-0248581eecad4a9ab6c633ad751ba0ec450660ef.tar.gz | |
use batchid in incomplete path, if it exists
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 831d9ba2..c24d43da 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -1028,7 +1028,12 @@ namespace slskd.Transfers.Downloads ? OptionsMonitor.CurrentValue.Permissions.File.Mode.ToUnixFileMode() : null; - var incompleteFilename = transfer.Filename.ToLocalFilename(baseDirectory: OptionsMonitor.CurrentValue.Directories.Incomplete); + // if the transfer has an associated batch id, store the incomplete file in a directory of the same name + // this is to ensure maximal safety when resuming failed downloads (otherwise we risk resuming an unrelated file) + var incompleteFilename = transfer.Filename.ToLocalFilename( + baseDirectory: System.IO.Path.Combine( + OptionsMonitor.CurrentValue.Directories.Incomplete, + transfer.BatchId.HasValue ? transfer.BatchId.ToString() : string.Empty)); Log.Debug("Invoking Soulseek DownloadAsync() for {Filename} from {Username}", transfer.Filename, transfer.Username); transfer.Attempts = 1; |
