episodes for series are now fetched using a single call and broken into seasons.

This commit is contained in:
kay.one 2013-06-01 12:31:39 -07:00
parent f7c78da4ed
commit 0c63e5ad81
12 changed files with 120 additions and 48 deletions

View file

@ -19,19 +19,13 @@ namespace NzbDrone.Api.Episodes
private List<EpisodeResource> GetEpisodes()
{
var seriesId = (int?)Request.Query.SeriesId;
var seasonNumber = (int?)Request.Query.SeasonNumber;
if (seriesId == null)
{
throw new BadRequestException("seriesId is missing");
}
if (seasonNumber == null)
{
return ToListResource(() => _episodeService.GetEpisodeBySeries(seriesId.Value));
}
return ToListResource(() => _episodeService.GetEpisodesBySeason(seriesId.Value, seasonNumber.Value));
return ToListResource(() => _episodeService.GetEpisodeBySeries(seriesId.Value));
}
}
}