1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00

New: Multiple Quality Profiles and Files Per Movie

This commit is contained in:
Qstick
2022-04-14 22:35:03 -05:00
parent 7ac5a5843b
commit af6b16ec57
183 changed files with 1911 additions and 1377 deletions
@@ -86,41 +86,41 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_return_true_if_it_is_a_search()
{
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, new MovieSearchCriteria()).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, new MovieSearchCriteria()).Should().OnlyContain(x => x.Accepted);
}
[Test]
public void should_return_true_if_latest_history_item_is_null()
{
Mocker.GetMock<IHistoryService>().Setup(s => s.MostRecentForMovie(It.IsAny<int>())).Returns((MovieHistory)null);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => x.Accepted);
}
[Test]
public void should_return_true_if_latest_history_item_is_not_grabbed()
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _notupgradableQuality, DateTime.UtcNow, MovieHistoryEventType.DownloadFailed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => x.Accepted);
}
// [Test]
// public void should_return_true_if_latest_history_has_a_download_id_and_cdh_is_enabled()
// {
// GivenMostRecentForEpisode(FIRST_EPISODE_ID, "test", _notupgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
// _upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
// _upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().OnlyContain(x => x.Accepted);
// }
[Test]
public void should_return_true_if_latest_history_item_is_older_than_twelve_hours()
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _notupgradableQuality, DateTime.UtcNow.AddHours(-13), MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => x.Accepted);
}
[Test]
public void should_be_upgradable_if_only_episode_is_upgradable()
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => x.Accepted);
}
/*
@@ -129,7 +129,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
GivenMostRecentForEpisode(SECOND_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().OnlyContain(x => x.Accepted);
}
[Test]
@@ -137,7 +137,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _notupgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
GivenMostRecentForEpisode(SECOND_EPISODE_ID, string.Empty, _notupgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().OnlyContain(x => !x.Accepted);
}
[Test]
@@ -145,7 +145,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _notupgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().OnlyContain(x => !x.Accepted);
}
[Test]
@@ -153,7 +153,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _notupgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
GivenMostRecentForEpisode(SECOND_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().OnlyContain(x => !x.Accepted);
}*/
[Test]
@@ -176,7 +176,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => !x.Accepted);
}
[Test]
@@ -195,14 +195,14 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => !x.Accepted);
}
[Test]
public void should_return_false_if_latest_history_item_is_only_one_hour_old()
{
GivenMostRecentForEpisode(FIRST_EPISODE_ID, string.Empty, _notupgradableQuality, DateTime.UtcNow.AddHours(-1), MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => !x.Accepted);
}
[Test]
@@ -210,7 +210,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenCdhDisabled();
GivenMostRecentForEpisode(FIRST_EPISODE_ID, "test", _upgradableQuality, DateTime.UtcNow.AddDays(-100), MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => x.Accepted);
}
[Test]
@@ -230,7 +230,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
GivenMostRecentForEpisode(FIRST_EPISODE_ID, "test", _upgradableQuality, DateTime.UtcNow.AddDays(-100), MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => !x.Accepted);
}
[Test]
@@ -238,7 +238,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
GivenCdhDisabled();
GivenMostRecentForEpisode(FIRST_EPISODE_ID, "test", _notupgradableQuality, DateTime.UtcNow.AddDays(-100), MovieHistoryEventType.Grabbed);
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
_upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().OnlyContain(x => !x.Accepted);
}
}
}