aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core/API/Controllers/ApplicationController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/slskd/Core/API/Controllers/ApplicationController.cs')
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs
index 82b1d6c5..501f8a9c 100644
--- a/src/slskd/Core/API/Controllers/ApplicationController.cs
+++ b/src/slskd/Core/API/Controllers/ApplicationController.cs
@@ -69,6 +69,13 @@ namespace slskd.Core.API
public IActionResult Shutdown()
{
Lifetime.StopApplication();
+
+ Task.Run(async () =>
+ {
+ await Task.Delay(500);
+ Environment.Exit(0);
+ });
+
return NoContent();
}
@@ -94,7 +101,7 @@ namespace slskd.Core.API
[Authorize]
public IActionResult GetVersion()
{
- return Ok(Program.InformationalVersion);
+ return Ok(Program.SemanticVersion);
}
/// <summary>
@@ -126,5 +133,20 @@ namespace slskd.Core.API
return Ok();
}
+
+ [HttpPut]
+ [Route("shares")]
+ [Authorize]
+ public IActionResult RescanSharesAsync()
+ {
+ if (ApplicationStateMonitor.CurrentValue.SharedFileCache.Filling)
+ {
+ return Conflict("A share scan is already in progress.");
+ }
+
+ _ = Application.RescanSharesAsync();
+
+ return Ok();
+ }
}
}