diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-09-01 18:43:31 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-09-01 18:43:31 -0500 |
| commit | 75d6377548ce946189d86aa9433281132ce58195 (patch) | |
| tree | 5e0a687c5b810076a6687ebb1d841df3a3b09ade /src | |
| parent | c82c64fa3c2df97d09b37d721ac7ce0eccec216c (diff) | |
| download | slskd-75d6377548ce946189d86aa9433281132ce58195.tar.gz | |
pull out destinationDirectory
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 92ab061f..00d6dbbc 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -319,12 +319,11 @@ namespace slskd.Transfers.Downloads // todo: broadcast to signalr hub SynchronizedUpdate(transfer, cancellable: false); - // this would be the ideal place to hook in a generic post-download task processor for now, we'll - // just carry out hard coded behavior. these carry the risk of failing the transfer, and i could - // argue both ways for that being the correct behavior. revisit this later. + var destinationDirectory = System.IO.Path.GetDirectoryName(file.Filename.ToLocalFilename(baseDirectory: OptionsMonitor.CurrentValue.Directories.Downloads)); + var finalFilename = Files.MoveFile( sourceFilename: file.Filename.ToLocalFilename(baseDirectory: OptionsMonitor.CurrentValue.Directories.Incomplete), - destinationDirectory: System.IO.Path.GetDirectoryName(file.Filename.ToLocalFilename(baseDirectory: OptionsMonitor.CurrentValue.Directories.Downloads)), + destinationDirectory: destinationDirectory, overwrite: false, deleteSourceDirectoryIfEmptyAfterMove: true); |
