1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 03:15:19 +00:00
Radarr/NzbDrone.Api/Series/SeriesLookupModule.cs
Keivan Beigi 343a794c2a existing series search shows first suggestion
requests are sent to server sequentially not to kill the client.
2013-05-24 19:09:03 -07:00

27 lines
No EOL
715 B
C#

using System.Threading;
using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.MetadataSource;
using System.Linq;
namespace NzbDrone.Api.Series
{
public class SeriesLookupModule : NzbDroneApiModule
{
private readonly ISearchForNewSeries _searchProxy;
public SeriesLookupModule(ISearchForNewSeries searchProxy)
: base("/Series/lookup")
{
_searchProxy = searchProxy;
Get["/"] = x => GetQualityType();
}
private Response GetQualityType()
{
var tvDbResults = _searchProxy.SearchForNewSeries((string)Request.Query.term);
return tvDbResults.FirstOrDefault().AsResponse();
}
}
}