aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Integrations/FTP/FTPService.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-07-24 14:39:40 -0500
committerGitHub <noreply@github.com>2021-07-24 14:39:40 -0500
commit58bc401dab5d7eb3bc6cb07a22e0ee9c97ddf4bd (patch)
tree64072f5eaa896335cc04de8ffe84fa79a50a2be7 /src/slskd/Integrations/FTP/FTPService.cs
parentfc7800409dfbe0cf26a72dd1de17cbae23d0cb35 (diff)
parent78b3b953d9c36c2cc2939ad00881b0cbf388865a (diff)
downloadslskd-58bc401dab5d7eb3bc6cb07a22e0ee9c97ddf4bd.tar.gz
Merge pull request #125 from slskd/options
Refactor configuration components to allow for run-time updates
Diffstat (limited to 'src/slskd/Integrations/FTP/FTPService.cs')
-rw-r--r--src/slskd/Integrations/FTP/FTPService.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/slskd/Integrations/FTP/FTPService.cs b/src/slskd/Integrations/FTP/FTPService.cs
index a5fe6a8f..becf1a12 100644
--- a/src/slskd/Integrations/FTP/FTPService.cs
+++ b/src/slskd/Integrations/FTP/FTPService.cs
@@ -15,6 +15,8 @@
// along with this program. If not, see https://www.gnu.org/licenses/.
// </copyright>
+using Microsoft.Extensions.Options;
+
namespace slskd.Integrations.FTP
{
using System;
@@ -38,18 +40,18 @@ namespace slskd.Integrations.FTP
/// <param name="log">The logger.</param>
public FTPService(
IFTPClientFactory ftpClientFactory,
- Microsoft.Extensions.Options.IOptionsMonitor<Options> optionsMonitor,
+ IOptionsMonitor<Options> optionsMonitor,
ILogger<FTPService> log)
{
Factory = ftpClientFactory;
- Options = optionsMonitor.CurrentValue;
+ OptionsMonitor = optionsMonitor;
Log = log;
}
private IFTPClientFactory Factory { get; set; }
- private FTPOptions FTPOptions => Options.Integration.FTP;
+ private FTPOptions FTPOptions => OptionsMonitor.CurrentValue.Integration.FTP;
private ILogger<FTPService> Log { get; set; }
- private Options Options { get; }
+ private IOptionsMonitor<Options> OptionsMonitor { get; }
/// <summary>
/// Uploads the specified <paramref name="filename"/> to the configured FTP server.