1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-28 02:40:01 +00:00
Radarr/NzbDrone.Services.Api/DailySeries/DailySeriesModule.cs
Mark McDowall b7575e05c1 Json.net instead of ServiceStack
More DailySeries repo work done
2013-02-15 16:52:38 -08:00

35 lines
No EOL
948 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Nancy;
using NzbDrone.Services.Api.Extensions;
namespace NzbDrone.Services.Api.DailySeries
{
public class DailySeriesModule : NancyModule
{
private readonly DailySeriesRepository _dailySeriesProvider;
public DailySeriesModule(DailySeriesRepository 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();
}
}
}