2013-01-20 01:37:48 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using Nancy;
|
2013-01-25 19:03:28 +00:00
|
|
|
|
using NzbDrone.Api.Extentions;
|
2013-01-20 01:37:48 +00:00
|
|
|
|
using NzbDrone.Api.QualityType;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.Series
|
|
|
|
|
{
|
|
|
|
|
public class SeriesModule : NzbDroneApiModule
|
|
|
|
|
{
|
|
|
|
|
private readonly TvDbProvider _tvDbProvider;
|
|
|
|
|
|
|
|
|
|
public SeriesModule(TvDbProvider tvDbProvider)
|
|
|
|
|
: base("/Series")
|
|
|
|
|
{
|
|
|
|
|
_tvDbProvider = tvDbProvider;
|
|
|
|
|
Get["/lookup"] = x => GetQualityType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Response GetQualityType()
|
|
|
|
|
{
|
|
|
|
|
var tvDbResults = _tvDbProvider.SearchSeries((string)Request.Query.term);
|
|
|
|
|
return tvDbResults.AsResponse();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|