aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-12-31 13:23:10 -0600
committerJP Dillingham <jp@dillingham.me>2022-12-31 13:23:10 -0600
commite38b44f5ae1f685bfcd32989570c7b0e4a457efe (patch)
tree9f45e50eba04dee9449293c526bbf8eb06e3b75d /src
parent3ffff66b0823cc15bcceddb9274639e3b2491588 (diff)
downloadslskd-e38b44f5ae1f685bfcd32989570c7b0e4a457efe.tar.gz
tweak agent broadcast logic
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs
index d1dfbd20..c85ff551 100644
--- a/src/slskd/Transfers/Downloads/DownloadService.cs
+++ b/src/slskd/Transfers/Downloads/DownloadService.cs
@@ -226,13 +226,18 @@ namespace slskd.Transfers.Downloads
// 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.
- MoveFile(file.Filename, OptionsMonitor.CurrentValue.Directories.Incomplete, OptionsMonitor.CurrentValue.Directories.Downloads);
+ var finalFilename = MoveFile(file.Filename, OptionsMonitor.CurrentValue.Directories.Incomplete, OptionsMonitor.CurrentValue.Directories.Downloads);
- Relay.BroadcastFileDownloadCompletedNotification(file.Filename);
+ Log.Debug("Moved file to {Destination}", finalFilename);
+
+ if (OptionsMonitor.CurrentValue.Relay.Enabled)
+ {
+ _ = Relay.BroadcastFileDownloadCompletedNotificationAsync(finalFilename);
+ }
if (OptionsMonitor.CurrentValue.Integration.Ftp.Enabled)
{
- _ = FTP.UploadAsync(file.Filename.ToLocalFilename(OptionsMonitor.CurrentValue.Directories.Downloads));
+ _ = FTP.UploadAsync(finalFilename);
}
}
catch (OperationCanceledException ex)