season list is properly populated in series details.

This commit is contained in:
kay.one 2013-03-03 14:26:41 -08:00
commit 62f15d4d96
18 changed files with 127 additions and 23 deletions

View file

@ -0,0 +1,29 @@
using System.Linq;
using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Seasons
{
public class SeasonModule : NzbDroneApiModule
{
private readonly ISeasonService _seasonService;
public SeasonModule(ISeasonService seasonService)
: base("/Season")
{
_seasonService = seasonService;
Get["/"] = x => GetSeasons();
}
private Response GetSeasons()
{
var seriesId = Request.Query.SeriesId;
return JsonExtensions.AsResponse(_seasonService.GetSeasonsBySeries(seriesId));
}
}
}