Fix validation for boolean query parameters
This commit is contained in:
parent
5de7322d60
commit
2fecd28001
|
@ -62,10 +62,8 @@ namespace Sonarr.Api.V3.Episodes
|
|||
|
||||
[HttpPut("monitor")]
|
||||
[Consumes("application/json")]
|
||||
public IActionResult SetEpisodesMonitored([FromBody] EpisodesMonitoredResource resource)
|
||||
public IActionResult SetEpisodesMonitored([FromBody] EpisodesMonitoredResource resource, [FromQuery] bool includeImages = false)
|
||||
{
|
||||
var includeImages = Request.GetBooleanQueryParameter("includeImages", false);
|
||||
|
||||
if (resource.EpisodeIds.Count == 1)
|
||||
{
|
||||
_episodeService.SetEpisodeMonitored(resource.EpisodeIds.First(), resource.Monitored);
|
||||
|
|
|
@ -138,9 +138,8 @@ namespace Sonarr.Api.V3.Series
|
|||
|
||||
[RestPutById]
|
||||
[Consumes("application/json")]
|
||||
public ActionResult<SeriesResource> UpdateSeries(SeriesResource seriesResource)
|
||||
public ActionResult<SeriesResource> UpdateSeries(SeriesResource seriesResource, bool moveFiles = false)
|
||||
{
|
||||
var moveFiles = Request.GetBooleanQueryParameter("moveFiles");
|
||||
var series = _seriesService.GetSeries(seriesResource.Id);
|
||||
|
||||
if (moveFiles)
|
||||
|
@ -167,11 +166,8 @@ namespace Sonarr.Api.V3.Series
|
|||
}
|
||||
|
||||
[RestDeleteById]
|
||||
public void DeleteSeries(int id)
|
||||
public void DeleteSeries(int id, bool deleteFiles = false, bool addImportListExclusion = false)
|
||||
{
|
||||
var deleteFiles = Request.GetBooleanQueryParameter("deleteFiles");
|
||||
var addImportListExclusion = Request.GetBooleanQueryParameter("addImportListExclusion");
|
||||
|
||||
_seriesService.DeleteSeries(new List<int> { id }, deleteFiles, addImportListExclusion);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue