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;
|
2013-03-04 06:53:02 +01:00
|
|
|
|
using NzbDrone.Core.MetadataSource;
|
2013-01-28 19:06:54 +01:00
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Api.Series
|
|
|
|
|
{
|
|
|
|
|
public class SeriesLookupModule : NzbDroneApiModule
|
|
|
|
|
{
|
2013-03-04 06:53:02 +01:00
|
|
|
|
private readonly TvDbProxy _tvDbProxy;
|
2013-01-28 19:06:54 +01:00
|
|
|
|
|
2013-03-04 06:53:02 +01:00
|
|
|
|
public SeriesLookupModule(TvDbProxy tvDbProxy)
|
2013-01-28 19:06:54 +01:00
|
|
|
|
: base("/Series/lookup")
|
|
|
|
|
{
|
2013-03-04 06:53:02 +01:00
|
|
|
|
_tvDbProxy = tvDbProxy;
|
2013-01-28 19:06:54 +01:00
|
|
|
|
Get["/"] = x => GetQualityType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Response GetQualityType()
|
|
|
|
|
{
|
2013-03-04 06:53:02 +01:00
|
|
|
|
var tvDbResults = _tvDbProxy.SearchSeries((string)Request.Query.term);
|
2013-01-28 19:06:54 +01:00
|
|
|
|
return tvDbResults.AsResponse();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|