aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Application/Management/API/Controllers/ApplicationController.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-08-05 09:46:33 -0500
committerGitHub <noreply@github.com>2021-08-05 09:46:33 -0500
commitadca7674d78c73ef2f2bd505bd4652460794826c (patch)
treee1a8812a3797b36846b5e00c53e478b938989dc2 /src/slskd/Application/Management/API/Controllers/ApplicationController.cs
parentfdded3572f465c2ddc3110c0927711537215fd58 (diff)
parentd33a280c2307925aa68102beaa2e61a38f8e7e6c (diff)
downloadslskd-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.cs18
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>