1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-01-04 22:40:51 +00:00
Sonarr/NzbDrone.Services.Api/DailySeries/DailySeriesModule.cs
2013-02-15 16:52:34 -08:00

35 lines
No EOL
949 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Nancy;
using NzbDrone.Services.Api.NancyExtensions;
namespace NzbDrone.Services.Api.DailySeries
{
public class DailySeriesModule : NancyModule
{
private readonly DailySeriesProvider _dailySeriesProvider;
public DailySeriesModule(DailySeriesProvider dailySeriesProvider)
: base("/dailyseries")
{
_dailySeriesProvider = dailySeriesProvider;
Get["/"] = x => OnGet();
Get["/all"] = x => OnGet();
Get["/{Id}"] = x => OnGet((int)x.Id);
Get["/isdaily/{Id}"] = x => OnGet((int)x.Id);
}
private Response OnGet()
{
return _dailySeriesProvider.Public().AsResponse();
}
private Response OnGet(int seriesId)
{
return _dailySeriesProvider.IsDaily(seriesId).AsResponse();
}
}
}