1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-31 20:15:55 +00:00
Lidarr/NzbDrone.Api/Calendar/CalendarModule.cs
Mark McDowall 6296e425d3 Added toastr, fullcalendar, start of API for Calendar.
Sending headers for DownloadString and DownloadFile in addition to DownloadStream.
2013-02-23 15:08:44 -08:00

30 lines
No EOL
855 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using AutoMapper;
using Nancy;
using NzbDrone.Api.Extentions;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Calendar
{
public class CalendarModule : NzbDroneApiModule
{
private readonly UpcomingEpisodesProvider _upcomingEpisodesProvider;
public CalendarModule(UpcomingEpisodesProvider upcomingEpisodesProvider)
: base("/Calendar")
{
_upcomingEpisodesProvider = upcomingEpisodesProvider;
Get["/"] = x => Calendar();
}
private Response Calendar()
{
var upcoming = _upcomingEpisodesProvider.UpcomingEpisodes();
return Mapper.Map<List<Episode>, List<CalendarResource>>(upcoming).AsResponse();
}
}
}