Fixed: Don't grab propers/repacks when item in queue meets cutoff and propers/repacks are not downloaded automatically

(cherry picked from commit cf00fecbe410caf1a57d561e458f2e58921eef05)

Closes #2210
This commit is contained in:
Mark McDowall
2023-02-19 00:32:58 -08:00
committed by Bogdan
parent 7d30c7d1ea
commit 2a01e9b445
2 changed files with 40 additions and 0 deletions
@@ -5,6 +5,7 @@ using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Books;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.DecisionEngine.Specifications;
using NzbDrone.Core.Download.TrackedDownloads;
@@ -369,5 +370,31 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_if_same_quality_non_proper_in_queue_and_download_propers_is_do_not_upgrade()
{
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.FLAC, new Revision(2));
_author.QualityProfile.Value.Cutoff = _remoteBook.ParsedBookInfo.Quality.Quality.Id;
Mocker.GetMock<IConfigService>()
.Setup(s => s.DownloadPropersAndRepacks)
.Returns(ProperDownloadTypes.DoNotUpgrade);
var remoteBook = Builder<RemoteBook>.CreateNew()
.With(r => r.Author = _author)
.With(r => r.Books = new List<Book> { _book })
.With(r => r.ParsedBookInfo = new ParsedBookInfo
{
Quality = new QualityModel(Quality.FLAC)
})
.With(r => r.Release = _releaseInfo)
.With(r => r.CustomFormats = new List<CustomFormat>())
.Build();
GivenQueue(new List<RemoteBook> { remoteBook });
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeFalse();
}
}
}