1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00
Radarr/NzbDrone.Api/Upcoming/UpcomingModule.cs
2013-02-23 12:35:26 -08:00

35 lines
982 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using AutoMapper;
using FluentValidation;
using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Api.Series;
using NzbDrone.Common;
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Upcoming
{
public class UpcomingModule : NzbDroneApiModule
{
private readonly UpcomingEpisodesProvider _upcomingEpisodesProvider;
public UpcomingModule(UpcomingEpisodesProvider upcomingEpisodesProvider)
: base("/Upcoming")
{
_upcomingEpisodesProvider = upcomingEpisodesProvider;
Get["/"] = x => Upcoming();
}
private Response Upcoming()
{
var upcoming = _upcomingEpisodesProvider.UpcomingEpisodes();
return Mapper.Map<List<Episode>, List<UpcomingResource>>(upcoming).AsResponse();
}
}
}