mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
fixed more tests.
This commit is contained in:
parent
48880e4964
commit
048162a0ef
45 changed files with 424 additions and 677 deletions
|
@ -6,13 +6,11 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
{
|
||||
public class NotInQueueSpecification : IFetchableSpecification
|
||||
{
|
||||
private readonly DownloadProvider _downloadProvider;
|
||||
private readonly IProvideDownloadClient _downloadClientProvider;
|
||||
|
||||
|
||||
public NotInQueueSpecification(DownloadProvider downloadProvider)
|
||||
public NotInQueueSpecification(IProvideDownloadClient downloadClientProvider)
|
||||
{
|
||||
_downloadProvider = downloadProvider;
|
||||
|
||||
_downloadClientProvider = downloadClientProvider;
|
||||
}
|
||||
|
||||
public string RejectionReason
|
||||
|
@ -25,7 +23,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
|
||||
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
|
||||
{
|
||||
return !_downloadProvider.GetActiveDownloadClient().IsInQueue(subject);
|
||||
return !_downloadClientProvider.GetDownloadClient().IsInQueue(subject);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
{
|
||||
foreach (var file in subject.Episodes.Select(c => c.EpisodeFile).Where(c => c != null))
|
||||
{
|
||||
_logger.Trace("Comparing file quality with report. Existing file is {0} proper:{1}", file.Quality, file.Proper);
|
||||
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, new QualityModel { Quality = file.Quality, Proper = file.Proper }, subject.Quality))
|
||||
_logger.Trace("Comparing file quality with report. Existing file is {0}", file.Quality);
|
||||
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, file.Quality, subject.Quality))
|
||||
return false;
|
||||
|
||||
if (subject.Quality.Proper && file.DateAdded < DateTime.Today.AddDays(-7))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue