2013-01-28 19:06:54 +01:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using Nancy;
|
2013-02-23 21:35:26 +01:00
|
|
|
|
using NzbDrone.Api.Extensions;
|
2013-01-28 19:06:54 +01:00
|
|
|
|
using NzbDrone.Api.QualityType;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.Series
|
|
|
|
|
{
|
|
|
|
|
public class SeriesLookupModule : NzbDroneApiModule
|
|
|
|
|
{
|
|
|
|
|
private readonly TvDbProvider _tvDbProvider;
|
|
|
|
|
|
|
|
|
|
public SeriesLookupModule(TvDbProvider tvDbProvider)
|
|
|
|
|
: base("/Series/lookup")
|
|
|
|
|
{
|
|
|
|
|
_tvDbProvider = tvDbProvider;
|
|
|
|
|
Get["/"] = x => GetQualityType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Response GetQualityType()
|
|
|
|
|
{
|
|
|
|
|
var tvDbResults = _tvDbProvider.SearchSeries((string)Request.Query.term);
|
|
|
|
|
return tvDbResults.AsResponse();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|