added some custom cells for resources.

This commit is contained in:
Keivan Beigi 2013-06-07 16:54:46 -07:00
commit bf499ed98a
5 changed files with 76 additions and 17 deletions

View file

@ -13,6 +13,7 @@ namespace NzbDrone.Api.Indexers
private readonly IFetchAndParseRss _rssFetcherAndParser;
private readonly ISearchForNzb _nzbSearchService;
private readonly IMakeDownloadDecision _downloadDecisionMaker;
private static List<DownloadDecision> results;
public ReleaseModule(IFetchAndParseRss rssFetcherAndParser, ISearchForNzb nzbSearchService, IMakeDownloadDecision downloadDecisionMaker)
{
@ -41,10 +42,14 @@ namespace NzbDrone.Api.Indexers
private List<ReleaseResource> GetRss()
{
var reports = _rssFetcherAndParser.Fetch();
var decisions = _downloadDecisionMaker.GetRssDecision(reports);
if (results == null)
{
var reports = _rssFetcherAndParser.Fetch();
var decisions = _downloadDecisionMaker.GetRssDecision(reports);
results = decisions;
}
return MapDecisions(decisions);
return MapDecisions(results);
}
private static List<ReleaseResource> MapDecisions(IEnumerable<DownloadDecision> decisions)