diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-08-05 09:46:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-05 09:46:33 -0500 |
| commit | adca7674d78c73ef2f2bd505bd4652460794826c (patch) | |
| tree | e1a8812a3797b36846b5e00c53e478b938989dc2 /src/slskd/Application/Management/API/Controllers/ApplicationController.cs | |
| parent | fdded3572f465c2ddc3110c0927711537215fd58 (diff) | |
| parent | d33a280c2307925aa68102beaa2e61a38f8e7e6c (diff) | |
| download | slskd-adca7674d78c73ef2f2bd505bd4652460794826c.tar.gz | |
Merge pull request #140 from slskd/share-hash
Make shared file cache fill asynchronous, enable re-scanning shares at runtime via API
Diffstat (limited to 'src/slskd/Application/Management/API/Controllers/ApplicationController.cs')
| -rw-r--r-- | src/slskd/Application/Management/API/Controllers/ApplicationController.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/slskd/Application/Management/API/Controllers/ApplicationController.cs b/src/slskd/Application/Management/API/Controllers/ApplicationController.cs index ddac832a..dd115786 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; /// <summary> /// Application. @@ -34,16 +33,27 @@ 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; } /// <summary> + /// Gets the current state of the application. + /// </summary> + /// <returns></returns> + [HttpGet] + [Authorize] + public IActionResult State() + { + return Ok(Management.ApplicationState); + } + + /// <summary> /// Stops the application. /// </summary> /// <returns></returns> |
