Added season pass for toggling monitored status of seasons

Linked from missing
This commit is contained in:
Mark McDowall 2013-08-05 02:09:41 -07:00
commit 6ca17942f0
12 changed files with 316 additions and 22 deletions

View file

@ -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));
}
}
}