No longer checking history when doing a manual search.

This commit is contained in:
Mark McDowall
2012-01-17 21:06:37 -08:00
parent 926bdef527
commit d1262f1ced
5 changed files with 56 additions and 19 deletions

View File

@@ -68,10 +68,11 @@ namespace NzbDrone.Core.Providers
/// Comprehensive check on whether or not this episode is needed.
/// </summary>
/// <param name = "parsedReport">Episode that needs to be checked</param>
/// <param name="manualSearch">False unless called by a manual search job</param>
/// <returns>Whether or not the file quality meets the requirements </returns>
/// <remarks>for multi episode files, all episodes need to meet the requirement
/// before the report is downloaded</remarks>
public virtual bool IsQualityNeeded(EpisodeParseResult parsedReport)
public virtual bool IsQualityNeeded(EpisodeParseResult parsedReport, bool manualSearch = false)
{
Logger.Trace("Checking if report meets quality requirements. {0}", parsedReport.Quality);
if (!parsedReport.Series.QualityProfile.Allowed.Contains(parsedReport.Quality.QualityType))
@@ -96,13 +97,16 @@ namespace NzbDrone.Core.Providers
return false;
}
//Checking History
var bestQualityInHistory = _historyProvider.GetBestQualityInHistory(episode.EpisodeId);
if (bestQualityInHistory != null)
//Checking History (If not a manual search)
if (!manualSearch)
{
Logger.Trace("Comparing history quality with report. History is {0}", bestQualityInHistory);
if (!IsUpgrade(bestQualityInHistory, parsedReport.Quality, cutoff))
return false;
var bestQualityInHistory = _historyProvider.GetBestQualityInHistory(episode.EpisodeId);
if(bestQualityInHistory != null)
{
Logger.Trace("Comparing history quality with report. History is {0}", bestQualityInHistory);
if(!IsUpgrade(bestQualityInHistory, parsedReport.Quality, cutoff))
return false;
}
}
}