mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 18:28:19 +00:00
29 lines
No EOL
643 B
C#
29 lines
No EOL
643 B
C#
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));
|
|
}
|
|
}
|
|
|
|
|
|
} |