1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-03-12 23:28:50 +00:00
Sonarr/NzbDrone.Api/Series/SeriesLookupModule.cs

28 lines
701 B
C#
Raw Normal View History

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