diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-26 10:57:58 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-26 10:57:58 -0500 |
| commit | e14c0a6b31d801118949408e12feae6bd43ea6da (patch) | |
| tree | b9970bf7e510291d4d4e7f407668cd47ad03988c /src/slskd/Shares/API/Controllers/SharesController.cs | |
| parent | ed922f1963148db85f256066c0c55cb5f308c2d3 (diff) | |
| download | slskd-e14c0a6b31d801118949408e12feae6bd43ea6da.tar.gz | |
improve behavior when kicking off scan
Diffstat (limited to 'src/slskd/Shares/API/Controllers/SharesController.cs')
| -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 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(); } |
