mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-26 22:46:53 -04:00
Cleaned up 2160p changes and added migration and tests.
Also reserved the quality ids for WEBRip etc.
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Datastore.Migration;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.Datastore.Migration
|
||||
{
|
||||
[TestFixture]
|
||||
public class add_ultrahd_quality_in_profilesFixture : MigrationTest<add_ultrahd_quality_in_profiles>
|
||||
{
|
||||
[Test]
|
||||
public void should_add_ultrahd_to_old_profile()
|
||||
{
|
||||
var db = WithMigrationTestDb(c =>
|
||||
{
|
||||
c.Insert.IntoTable("Profiles").Row(new
|
||||
{
|
||||
Id = 0,
|
||||
Name = "SDTV",
|
||||
Cutoff = 1,
|
||||
Items = "[ { \"quality\": 1, \"allowed\": true } ]",
|
||||
Language = 1
|
||||
});
|
||||
});
|
||||
|
||||
var profiles = db.Query<Profile70>("SELECT Items FROM Profiles LIMIT 1");
|
||||
|
||||
var items = profiles.First().Items;
|
||||
items.Should().HaveCount(4);
|
||||
items.Select(v => v.Quality).Should().BeEquivalentTo(1, 16, 18, 19);
|
||||
items.Select(v => v.Allowed).Should().BeEquivalentTo(true, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,6 +119,7 @@
|
||||
<Compile Include="Datastore\DatabaseRelationshipFixture.cs" />
|
||||
<Compile Include="Datastore\MappingExtentionFixture.cs" />
|
||||
<Compile Include="Datastore\MarrDataLazyLoadingFixture.cs" />
|
||||
<Compile Include="Datastore\Migration\101_add_ultrahd_quality_in_profilesFixture.cs" />
|
||||
<Compile Include="Datastore\Migration\071_unknown_quality_in_profileFixture.cs" />
|
||||
<Compile Include="Datastore\Migration\072_history_downloadIdFixture.cs" />
|
||||
<Compile Include="Datastore\Migration\070_delay_profileFixture.cs" />
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace NzbDrone.Core.Test.Qualities
|
||||
new object[] {8, Quality.WEBDL480p},
|
||||
new object[] {9, Quality.HDTV1080p},
|
||||
new object[] {10, Quality.RAWHD},
|
||||
new object[] {12, Quality.HDTV2160p},
|
||||
new object[] {13, Quality.WEBDL2160p},
|
||||
new object[] {14, Quality.Bluray2160p},
|
||||
new object[] {16, Quality.HDTV2160p},
|
||||
new object[] {18, Quality.WEBDL2160p},
|
||||
new object[] {19, Quality.Bluray2160p},
|
||||
};
|
||||
|
||||
public static object[] ToIntCases =
|
||||
@@ -42,9 +42,9 @@ namespace NzbDrone.Core.Test.Qualities
|
||||
new object[] {Quality.WEBDL480p, 8},
|
||||
new object[] {Quality.HDTV1080p, 9},
|
||||
new object[] {Quality.RAWHD, 10},
|
||||
new object[] {Quality.HDTV2160p, 12},
|
||||
new object[] {Quality.WEBDL2160p, 13},
|
||||
new object[] {Quality.Bluray2160p, 14},
|
||||
new object[] {Quality.HDTV2160p, 16},
|
||||
new object[] {Quality.WEBDL2160p, 18},
|
||||
new object[] {Quality.Bluray2160p, 19},
|
||||
};
|
||||
|
||||
[Test, TestCaseSource("FromIntCases")]
|
||||
|
||||
Reference in New Issue
Block a user