mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
Fix validation for boolean query parameters
(cherry picked from commit 2fecd280016630d5afe2d60e52cbb52338c155b5) Closes #8517
This commit is contained in:
parent
10bb8fa263
commit
48b9bb9427
@ -222,9 +222,8 @@ public ActionResult<MovieResource> AddMovie(MovieResource moviesResource)
|
||||
}
|
||||
|
||||
[RestPutById]
|
||||
public ActionResult<MovieResource> UpdateMovie(MovieResource moviesResource)
|
||||
public ActionResult<MovieResource> UpdateMovie(MovieResource moviesResource, bool moveFiles = false)
|
||||
{
|
||||
var moveFiles = Request.GetBooleanQueryParameter("moveFiles");
|
||||
var movie = _moviesService.GetMovie(moviesResource.Id);
|
||||
|
||||
if (moveFiles)
|
||||
@ -255,12 +254,9 @@ public ActionResult<MovieResource> UpdateMovie(MovieResource moviesResource)
|
||||
}
|
||||
|
||||
[RestDeleteById]
|
||||
public void DeleteMovie(int id)
|
||||
public void DeleteMovie(int id, bool deleteFiles = false, bool addImportExclusion = false)
|
||||
{
|
||||
var addExclusion = Request.GetBooleanQueryParameter("addImportExclusion");
|
||||
var deleteFiles = Request.GetBooleanQueryParameter("deleteFiles");
|
||||
|
||||
_moviesService.DeleteMovie(id, deleteFiles, addExclusion);
|
||||
_moviesService.DeleteMovie(id, deleteFiles, addImportExclusion);
|
||||
}
|
||||
|
||||
private void MapCoversToLocal(MovieResource movie)
|
||||
|
Loading…
Reference in New Issue
Block a user