From e38b44f5ae1f685bfcd32989570c7b0e4a457efe Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 31 Dec 2022 13:23:10 -0600 Subject: tweak agent broadcast logic --- src/slskd/Transfers/Downloads/DownloadService.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') 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) -- cgit v1.2.3