mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Added toastr, fullcalendar, start of API for Calendar.
Sending headers for DownloadString and DownloadFile in addition to DownloadStream.
This commit is contained in:
parent
f568fdad6a
commit
6296e425d3
15 changed files with 5624 additions and 82 deletions
30
NzbDrone.Api/Calendar/CalendarModule.cs
Normal file
30
NzbDrone.Api/Calendar/CalendarModule.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue