|
|
@ -1,6 +1,8 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Nancy;
|
|
|
|
using Nancy;
|
|
|
|
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Api.Mapping;
|
|
|
|
using NzbDrone.Api.Mapping;
|
|
|
|
|
|
|
|
using NzbDrone.Common.Instrumentation;
|
|
|
|
using NzbDrone.Core.DecisionEngine;
|
|
|
|
using NzbDrone.Core.DecisionEngine;
|
|
|
|
using NzbDrone.Core.Download;
|
|
|
|
using NzbDrone.Core.Download;
|
|
|
|
using NzbDrone.Core.IndexerSearch;
|
|
|
|
using NzbDrone.Core.IndexerSearch;
|
|
|
@ -21,18 +23,21 @@ namespace NzbDrone.Api.Indexers
|
|
|
|
private readonly IMakeDownloadDecision _downloadDecisionMaker;
|
|
|
|
private readonly IMakeDownloadDecision _downloadDecisionMaker;
|
|
|
|
private readonly IDownloadService _downloadService;
|
|
|
|
private readonly IDownloadService _downloadService;
|
|
|
|
private readonly IParsingService _parsingService;
|
|
|
|
private readonly IParsingService _parsingService;
|
|
|
|
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
|
|
|
public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
|
|
|
ISearchForNzb nzbSearchService,
|
|
|
|
ISearchForNzb nzbSearchService,
|
|
|
|
IMakeDownloadDecision downloadDecisionMaker,
|
|
|
|
IMakeDownloadDecision downloadDecisionMaker,
|
|
|
|
IDownloadService downloadService,
|
|
|
|
IDownloadService downloadService,
|
|
|
|
IParsingService parsingService)
|
|
|
|
IParsingService parsingService,
|
|
|
|
|
|
|
|
Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_rssFetcherAndParser = rssFetcherAndParser;
|
|
|
|
_rssFetcherAndParser = rssFetcherAndParser;
|
|
|
|
_nzbSearchService = nzbSearchService;
|
|
|
|
_nzbSearchService = nzbSearchService;
|
|
|
|
_downloadDecisionMaker = downloadDecisionMaker;
|
|
|
|
_downloadDecisionMaker = downloadDecisionMaker;
|
|
|
|
_downloadService = downloadService;
|
|
|
|
_downloadService = downloadService;
|
|
|
|
_parsingService = parsingService;
|
|
|
|
_parsingService = parsingService;
|
|
|
|
|
|
|
|
_logger = logger;
|
|
|
|
GetResourceAll = GetReleases;
|
|
|
|
GetResourceAll = GetReleases;
|
|
|
|
Post["/"] = x=> DownloadRelease(this.Bind<ReleaseResource>());
|
|
|
|
Post["/"] = x=> DownloadRelease(this.Bind<ReleaseResource>());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -60,6 +65,7 @@ namespace NzbDrone.Api.Indexers
|
|
|
|
private List<ReleaseResource> GetEpisodeReleases(int episodeId)
|
|
|
|
private List<ReleaseResource> GetEpisodeReleases(int episodeId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var decisions = _nzbSearchService.EpisodeSearch(episodeId);
|
|
|
|
var decisions = _nzbSearchService.EpisodeSearch(episodeId);
|
|
|
|
|
|
|
|
|
|
|
|
return MapDecisions(decisions);
|
|
|
|
return MapDecisions(decisions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|