aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares/API
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-26 10:57:58 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-26 10:57:58 -0500
commite14c0a6b31d801118949408e12feae6bd43ea6da (patch)
treeb9970bf7e510291d4d4e7f407668cd47ad03988c /src/slskd/Shares/API
parented922f1963148db85f256066c0c55cb5f308c2d3 (diff)
downloadslskd-e14c0a6b31d801118949408e12feae6bd43ea6da.tar.gz
improve behavior when kicking off scan
Diffstat (limited to 'src/slskd/Shares/API')
-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();
}