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")]
|
[HttpPut("monitor")]
|
||||||
[Consumes("application/json")]
|
[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)
|
if (resource.EpisodeIds.Count == 1)
|
||||||
{
|
{
|
||||||
_episodeService.SetEpisodeMonitored(resource.EpisodeIds.First(), resource.Monitored);
|
_episodeService.SetEpisodeMonitored(resource.EpisodeIds.First(), resource.Monitored);
|
||||||
|
|
|
@ -138,9 +138,8 @@ namespace Sonarr.Api.V3.Series
|
||||||
|
|
||||||
[RestPutById]
|
[RestPutById]
|
||||||
[Consumes("application/json")]
|
[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);
|
var series = _seriesService.GetSeries(seriesResource.Id);
|
||||||
|
|
||||||
if (moveFiles)
|
if (moveFiles)
|
||||||
|
@ -167,11 +166,8 @@ namespace Sonarr.Api.V3.Series
|
||||||
}
|
}
|
||||||
|
|
||||||
[RestDeleteById]
|
[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);
|
_seriesService.DeleteSeries(new List<int> { id }, deleteFiles, addImportListExclusion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue