diff options
Diffstat (limited to 'src/slskd/Shares/API/Controllers')
| -rw-r--r-- | src/slskd/Shares/API/Controllers/SharesController.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/slskd/Shares/API/Controllers/SharesController.cs b/src/slskd/Shares/API/Controllers/SharesController.cs index 64d703bd..4e328717 100644 --- a/src/slskd/Shares/API/Controllers/SharesController.cs +++ b/src/slskd/Shares/API/Controllers/SharesController.cs @@ -153,15 +153,13 @@ namespace slskd.Shares.API [ProducesResponseType(409)] public IActionResult RescanSharesAsync() { - try + if (Shares.StateMonitor.CurrentValue.Scanning) { - _ = Shares.ScanAsync(); - } - catch (ShareScanInProgressException) - { - return Conflict("A share scan is already in progress."); + return Conflict("A share scan is already in progress"); } + _ = Shares.ScanAsync(); + return Ok(); } |
