From 2f554d1ccbb2fa677b810c861c389a6142576573 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 30 Dec 2022 17:22:18 -0600 Subject: broadcast file completions --- src/slskd/Transfers/Downloads/DownloadService.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 4c3a7298..5a4aa170 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -31,6 +31,7 @@ namespace slskd.Transfers.Downloads using Microsoft.EntityFrameworkCore; using Serilog; using slskd.Integrations.FTP; + using slskd.Relay; /// /// Manages downloads. @@ -41,18 +42,21 @@ namespace slskd.Transfers.Downloads IOptionsMonitor optionsMonitor, ISoulseekClient soulseekClient, IDbContextFactory contextFactory, + IRelayService relayService, IFTPService ftpClient) { Client = soulseekClient; OptionsMonitor = optionsMonitor; ContextFactory = contextFactory; FTP = ftpClient; + Relay = relayService; } private ConcurrentDictionary CancellationTokens { get; } = new ConcurrentDictionary(); private ISoulseekClient Client { get; } private IDbContextFactory ContextFactory { get; } private IFTPService FTP { get; } + private IRelayService Relay { get; } private ILogger Log { get; } = Serilog.Log.ForContext(); private IOptionsMonitor OptionsMonitor { get; } @@ -224,6 +228,8 @@ namespace slskd.Transfers.Downloads // argue both ways for that being the correct behavior. revisit this later. MoveFile(file.Filename, OptionsMonitor.CurrentValue.Directories.Incomplete, OptionsMonitor.CurrentValue.Directories.Downloads); + Relay.BroadcastFileDownloadCompletedNotification(file.Filename); + if (OptionsMonitor.CurrentValue.Integration.Ftp.Enabled) { _ = FTP.UploadAsync(file.Filename.ToLocalFilename(OptionsMonitor.CurrentValue.Directories.Downloads)); -- cgit v1.2.3