From 3f5ebfde9be34a80a28dc8c08efaa4c9417184dc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 14 Jul 2021 08:39:15 -0500 Subject: simplify using for microsoft Options --- src/slskd/Application/Management/ManagementService.cs | 6 ++++-- .../Application/Transfer/API/Controllers/TransfersController.cs | 4 +++- src/slskd/Integrations/FTP/FTPClientFactory.cs | 4 +++- src/slskd/Integrations/FTP/FTPService.cs | 4 +++- src/slskd/Integrations/Pushbullet/PushbulletService.cs | 4 +++- src/slskd/Properties/analysis.ruleset | 1 + 6 files changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/slskd/Application/Management/ManagementService.cs b/src/slskd/Application/Management/ManagementService.cs index 4a385cff..7bcdc7be 100644 --- a/src/slskd/Application/Management/ManagementService.cs +++ b/src/slskd/Application/Management/ManagementService.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // +using Microsoft.Extensions.Options; + namespace slskd.Management { using System; @@ -32,7 +34,7 @@ namespace slskd.Management /// The options monitor used to derive application options. /// The Soulseek client. public ManagementService( - Microsoft.Extensions.Options.IOptionsMonitor optionsMonitor, + IOptionsMonitor optionsMonitor, ISoulseekClient soulseekClient) { OptionsMonitor = optionsMonitor; @@ -41,7 +43,7 @@ namespace slskd.Management private ISoulseekClient Client { get; } private Options Options => OptionsMonitor.CurrentValue; - private Microsoft.Extensions.Options.IOptionsMonitor OptionsMonitor { get; } + private IOptionsMonitor OptionsMonitor { get; } /// /// Connects the Soulseek client to the server using the configured username and password. diff --git a/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs b/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs index 97b86689..9ed36d1b 100644 --- a/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs +++ b/src/slskd/Application/Transfer/API/Controllers/TransfersController.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // +using Microsoft.Extensions.Options; + namespace slskd.Transfer.API { using System; @@ -46,7 +48,7 @@ namespace slskd.Transfer.API /// /// public TransfersController( - Microsoft.Extensions.Options.IOptionsSnapshot options, + IOptionsSnapshot options, ISoulseekClient client, ITransferTracker tracker, IFTPService ftpClient) diff --git a/src/slskd/Integrations/FTP/FTPClientFactory.cs b/src/slskd/Integrations/FTP/FTPClientFactory.cs index cc076ca1..7c55195f 100644 --- a/src/slskd/Integrations/FTP/FTPClientFactory.cs +++ b/src/slskd/Integrations/FTP/FTPClientFactory.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // +using Microsoft.Extensions.Options; + namespace slskd.Integrations.FTP { using System; @@ -30,7 +32,7 @@ namespace slskd.Integrations.FTP /// Initializes a new instance of the class. /// /// The options monitor used to derive application options. - public FTPClientFactory(Microsoft.Extensions.Options.IOptionsMonitor optionsMonitor) + public FTPClientFactory(IOptionsMonitor optionsMonitor) { Options = optionsMonitor.CurrentValue; diff --git a/src/slskd/Integrations/FTP/FTPService.cs b/src/slskd/Integrations/FTP/FTPService.cs index a5fe6a8f..4b3f45ce 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/. // +using Microsoft.Extensions.Options; + namespace slskd.Integrations.FTP { using System; @@ -38,7 +40,7 @@ namespace slskd.Integrations.FTP /// The logger. public FTPService( IFTPClientFactory ftpClientFactory, - Microsoft.Extensions.Options.IOptionsMonitor optionsMonitor, + IOptionsMonitor optionsMonitor, ILogger log) { Factory = ftpClientFactory; diff --git a/src/slskd/Integrations/Pushbullet/PushbulletService.cs b/src/slskd/Integrations/Pushbullet/PushbulletService.cs index cb31e6dc..04994d92 100644 --- a/src/slskd/Integrations/Pushbullet/PushbulletService.cs +++ b/src/slskd/Integrations/Pushbullet/PushbulletService.cs @@ -15,6 +15,8 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // +using Microsoft.Extensions.Options; + namespace slskd.Integrations.Pushbullet { using System; @@ -41,7 +43,7 @@ namespace slskd.Integrations.Pushbullet /// The logger. public PushbulletService( IHttpClientFactory httpClientFactory, - Microsoft.Extensions.Options.IOptionsMonitor optionsMonitor, + IOptionsMonitor optionsMonitor, ILogger log) { HttpClientFactory = httpClientFactory; diff --git a/src/slskd/Properties/analysis.ruleset b/src/slskd/Properties/analysis.ruleset index 09e99d9e..4e4ae5cf 100644 --- a/src/slskd/Properties/analysis.ruleset +++ b/src/slskd/Properties/analysis.ruleset @@ -45,6 +45,7 @@ + -- cgit v1.2.3