Search Results grid added.

This commit is contained in:
Mark McDowall 2012-04-21 01:16:15 -07:00
commit 4f005e45c0
12 changed files with 191 additions and 31 deletions

View file

@ -172,22 +172,20 @@ namespace NzbDrone.Core.Providers
if (episode.Series.IsDaily)
{
searchResult.AirDate = episode.AirDate.Value;
searchResult.SearchResultItems = ProcessSearchResults(notification, reports, episode.Series, episode.AirDate.Value);
_searchResultProvider.Add(searchResult);
if (searchResult.SearchResultItems.Any(r => r.Success))
return true;
return false;
}
if (!episode.Series.IsDaily)
else
{
searchResult.SeasonNumber = episode.SeasonNumber;
searchResult.EpisodeId = episodeId;
ProcessSearchResults(notification, reports, episode.Series, episode.SeasonNumber, episode.EpisodeNumber);
searchResult.SearchResultItems = ProcessSearchResults(notification, reports, episode.Series, episode.SeasonNumber, episode.EpisodeNumber);
_searchResultProvider.Add(searchResult);
if (searchResult.SearchResultItems.Any(r => r.Success))
return true;
}
@ -272,7 +270,8 @@ namespace NzbDrone.Core.Providers
var item = new SearchResultItem
{
ReportTitle = episodeParseResult.OriginalString,
NzbUrl = episodeParseResult.NzbUrl
NzbUrl = episodeParseResult.NzbUrl,
Indexer = episodeParseResult.Indexer
};
items.Add(item);
@ -312,8 +311,8 @@ namespace NzbDrone.Core.Providers
continue;
}
var rejectionType = _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult);
if (rejectionType == ReportRejectionType.None)
item.SearchError = _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult);
if (item.SearchError == ReportRejectionType.None)
{
Logger.Debug("Found '{0}'. Adding to download queue.", episodeParseResult);
try
@ -360,7 +359,8 @@ namespace NzbDrone.Core.Providers
var item = new SearchResultItem
{
ReportTitle = episodeParseResult.OriginalString,
NzbUrl = episodeParseResult.NzbUrl
NzbUrl = episodeParseResult.NzbUrl,
Indexer = episodeParseResult.Indexer
};
items.Add(item);
@ -390,8 +390,8 @@ namespace NzbDrone.Core.Providers
continue;
}
var allowedDownload = _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult);
if (allowedDownload == ReportRejectionType.None)
item.SearchError = _allowedDownloadSpecification.IsSatisfiedBy(episodeParseResult);
if (item.SearchError == ReportRejectionType.None)
{
Logger.Debug("Found '{0}'. Adding to download queue.", episodeParseResult);
try
@ -416,10 +416,6 @@ namespace NzbDrone.Core.Providers
notification.CurrentMessage = String.Format("Unable to add report to download queue. {0}", episodeParseResult);
}
}
else
{
item.SearchError = allowedDownload;
}
}
catch (Exception e)
{