From acd293a58a8efe20f98d8702d4823fae5ef81316 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 10 Sep 2021 18:21:23 -0500 Subject: remove I/ManagementService --- .../Management/API/Controllers/ConfigurationController.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/slskd/Application/Management/API/Controllers/ConfigurationController.cs') diff --git a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs b/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs index f2b90718..b8c81f84 100644 --- a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs +++ b/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs @@ -34,15 +34,18 @@ namespace slskd.Management.API public class ConfigurationController : ControllerBase { public ConfigurationController( + IApplication application, IOptionsSnapshot optionsShapshot, - IManagementService managementService) + IStateMonitor applicationStateMonitor) { + Application = application; OptionsShapshot = optionsShapshot; - ManagementService = managementService; + ApplicationStateMonitor = applicationStateMonitor; } - private IManagementService ManagementService { get; } + private IApplication Application { get; } private IOptionsSnapshot OptionsShapshot { get; } + private IStateMonitor ApplicationStateMonitor { get; } [HttpGet] [Route("")] @@ -58,12 +61,12 @@ namespace slskd.Management.API [Authorize] public IActionResult RescanSharesAsync() { - if (ManagementService.SharedFileCacheState.Filling) + if (ApplicationStateMonitor.CurrentValue.SharedFileCache.Filling) { return Conflict("A share scan is already in progress."); } - _ = ManagementService.RescanSharesAsync(); + _ = Application.RescanSharesAsync(); return Ok(); } -- cgit v1.2.3