diff options
Diffstat (limited to 'src/slskd/Application/Management/API/Controllers/ConfigurationController.cs')
| -rw-r--r-- | src/slskd/Application/Management/API/Controllers/ConfigurationController.cs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs b/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs index 26ce6c52..c44cf2f2 100644 --- a/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs +++ b/src/slskd/Application/Management/API/Controllers/ConfigurationController.cs @@ -19,7 +19,6 @@ using Microsoft.Extensions.Options; namespace slskd.Application.Management.API { - using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using slskd.Management; @@ -50,6 +49,7 @@ namespace slskd.Application.Management.API private IStateMonitor<SharedFileCacheState> SharedFileCacheMonitor { get; } [HttpGet] + [Route("")] [Authorize] public IActionResult GetOptions() { @@ -58,18 +58,17 @@ namespace slskd.Application.Management.API } [HttpPut] + [Route("shares")] [Authorize] - public async Task<IActionResult> RescanSharesAsync() + public IActionResult RescanSharesAsync() { - try + if (SharedFileCacheMonitor.CurrentValue.Filling) { - await ManagementService.RescanSharesAsync(); - } - catch (ShareScanInProgressException ex) - { - return Conflict(ex.Message); + return Conflict("A share scan is already in progress."); } + _ = ManagementService.RescanSharesAsync(); + return Ok(); } } |
