1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

New: Option to not prefer repacks/propers (for use with Custom Formats)

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick
2020-09-05 02:18:42 -04:00
parent d31b1e1e9b
commit ecf6dccb35
20 changed files with 279 additions and 134 deletions
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
@@ -51,11 +51,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
CustomFormatsFixture.GivenCustomFormats(_customFormat1, _customFormat2);
}
private void GivenAutoDownloadPropers(bool autoDownloadPropers)
private void GivenAutoDownloadPropers(ProperDownloadTypes type)
{
Mocker.GetMock<IConfigService>()
.SetupGet(s => s.AutoDownloadPropers)
.Returns(autoDownloadPropers);
.SetupGet(s => s.DownloadPropersAndRepacks)
.Returns(type);
}
[Test]
@@ -68,7 +68,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
List<CustomFormat> newFormats,
bool expected)
{
GivenAutoDownloadPropers(true);
GivenAutoDownloadPropers(ProperDownloadTypes.PreferAndUpgrade);
var profile = new Profile
{
@@ -86,9 +86,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
}
[Test]
public void should_return_false_if_proper_and_autoDownloadPropers_is_false()
public void should_return_true_if_proper_and_download_propers_is_do_not_download()
{
GivenAutoDownloadPropers(false);
GivenAutoDownloadPropers(ProperDownloadTypes.DoNotUpgrade);
var profile = new Profile { Items = Qualities.QualityFixture.GetDefaultQualities() };