mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
Added season pass for toggling monitored status of seasons
Linked from missing
This commit is contained in:
parent
694714726c
commit
6ca17942f0
12 changed files with 316 additions and 22 deletions
|
@ -14,13 +14,20 @@ namespace NzbDrone.Api.Seasons
|
|||
|
||||
GetResourceAll = GetSeasons;
|
||||
UpdateResource = SetMonitored;
|
||||
|
||||
Post["/pass"] = x => SetSeasonPass();
|
||||
}
|
||||
|
||||
private List<SeasonResource> GetSeasons()
|
||||
{
|
||||
var seriesId = Request.Query.SeriesId;
|
||||
|
||||
return ToListResource<Season>(() => _seasonService.GetSeasonsBySeries(seriesId));
|
||||
if (seriesId.HasValue)
|
||||
{
|
||||
return ToListResource<Season>(() => _seasonService.GetSeasonsBySeries(seriesId));
|
||||
}
|
||||
|
||||
return ToListResource<Season>(() => _seasonService.GetAllSeasons());
|
||||
}
|
||||
|
||||
private SeasonResource SetMonitored(SeasonResource seasonResource)
|
||||
|
@ -29,5 +36,13 @@ namespace NzbDrone.Api.Seasons
|
|||
|
||||
return seasonResource;
|
||||
}
|
||||
|
||||
private List<SeasonResource> SetSeasonPass()
|
||||
{
|
||||
var seriesId = Request.Form.SeriesId;
|
||||
var seasonNumber = Request.Form.SeasonNumber;
|
||||
|
||||
return ToListResource<Season>(() => _seasonService.SetSeasonPass(seriesId, seasonNumber));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue