From 43f3bf2d128dc7e44043a8ef2199d75cdb0d3d4b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 3 Aug 2021 09:25:10 -0500 Subject: add plumbing to rescan shares via API --- .../API/Controllers/ApplicationController.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/slskd/Application/Management/API/Controllers/ApplicationController.cs') diff --git a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs b/src/slskd/Application/Management/API/Controllers/ApplicationController.cs index ddac832a..43029aa5 100644 --- a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs +++ b/src/slskd/Application/Management/API/Controllers/ApplicationController.cs @@ -22,7 +22,6 @@ namespace slskd.Management.API using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Hosting; - using Soulseek; /// /// Application. @@ -34,15 +33,26 @@ namespace slskd.Management.API [Consumes("application/json")] public class ApplicationController : ControllerBase { - public ApplicationController(ISoulseekClient client, IHostApplicationLifetime lifetime) + public ApplicationController(IManagementService managementService, IHostApplicationLifetime lifetime) { - Client = client; + Management = managementService; Lifetime = lifetime; } - private ISoulseekClient Client { get; } + private IManagementService Management { get; } private IHostApplicationLifetime Lifetime { get; } + /// + /// Gets the current state of the application. + /// + /// + [HttpGet] + [Authorize] + public IActionResult State() + { + return Ok(Management.GetServiceState()); + } + /// /// Stops the application. /// -- cgit v1.2.3