aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares/API/Controllers/SharesController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/slskd/Shares/API/Controllers/SharesController.cs')
-rw-r--r--src/slskd/Shares/API/Controllers/SharesController.cs10
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 76ec4643..1ce1f88e 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();
}