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.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/slskd/Shares/API/Controllers/SharesController.cs b/src/slskd/Shares/API/Controllers/SharesController.cs
index 12a1c7b2..a8d5ae96 100644
--- a/src/slskd/Shares/API/Controllers/SharesController.cs
+++ b/src/slskd/Shares/API/Controllers/SharesController.cs
@@ -189,5 +189,26 @@ namespace slskd.Shares.API
return Ok();
}
+
+ /// <summary>
+ /// Cancels a share scan, if one is running.
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="204">The request completed successfully.</response>
+ /// <response code="409">A share scan was not in progress.</response>
+ [HttpDelete]
+ [Route("")]
+ [Authorize]
+ [ProducesResponseType(204)]
+ [ProducesResponseType(404)]
+ public IActionResult CancelShareScan()
+ {
+ if (Shares.TryCancelScan())
+ {
+ return StatusCode(204);
+ }
+
+ return NotFound();
+ }
}
}