New: Readarr 0.1

This commit is contained in:
ta264
2020-05-06 21:14:11 +01:00
parent 476f2d6047
commit 08496c82af
911 changed files with 14837 additions and 24442 deletions
@@ -13,36 +13,7 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
[Test]
public void should_be_able_to_read_and_write()
{
var profile = new MetadataProfile
{
PrimaryAlbumTypes = PrimaryAlbumType.All.OrderByDescending(l => l.Name).Select(l => new ProfilePrimaryAlbumTypeItem
{
PrimaryAlbumType = l,
Allowed = l == PrimaryAlbumType.Album
}).ToList(),
SecondaryAlbumTypes = SecondaryAlbumType.All.OrderByDescending(l => l.Name).Select(l => new ProfileSecondaryAlbumTypeItem
{
SecondaryAlbumType = l,
Allowed = l == SecondaryAlbumType.Studio
}).ToList(),
ReleaseStatuses = ReleaseStatus.All.OrderByDescending(l => l.Name).Select(l => new ProfileReleaseStatusItem
{
ReleaseStatus = l,
Allowed = l == ReleaseStatus.Official
}).ToList(),
Name = "TestProfile"
};
Subject.Insert(profile);
StoredModel.Name.Should().Be(profile.Name);
StoredModel.PrimaryAlbumTypes.Should().Equal(profile.PrimaryAlbumTypes, (a, b) => a.PrimaryAlbumType == b.PrimaryAlbumType && a.Allowed == b.Allowed);
StoredModel.SecondaryAlbumTypes.Should().Equal(profile.SecondaryAlbumTypes, (a, b) => a.SecondaryAlbumType == b.SecondaryAlbumType && a.Allowed == b.Allowed);
StoredModel.ReleaseStatuses.Should().Equal(profile.ReleaseStatuses, (a, b) => a.ReleaseStatus == b.ReleaseStatus && a.Allowed == b.Allowed);
// TODO: restore
}
}
}
@@ -61,14 +61,6 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
var profiles = Builder<MetadataProfile>.CreateListOfSize(2)
.TheFirst(1)
.With(x => x.Name = MetadataProfileService.NONE_PROFILE_NAME)
.With(x => x.PrimaryAlbumTypes = new List<ProfilePrimaryAlbumTypeItem>
{
new ProfilePrimaryAlbumTypeItem
{
PrimaryAlbumType = PrimaryAlbumType.Album,
Allowed = true
}
})
.BuildList();
Mocker.GetMock<IMetadataProfileRepository>()
@@ -113,7 +105,7 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
.With(p => p.Id = 2)
.Build();
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.Random(1)
.With(c => c.MetadataProfileId = profile.Id)
.Build().ToList();
@@ -145,7 +137,7 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
.With(p => p.Id = 2)
.Build();
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.All()
.With(c => c.MetadataProfileId = 1)
.Build().ToList();
@@ -177,7 +169,7 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
.With(p => p.Id = 2)
.Build();
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.All()
.With(c => c.MetadataProfileId = 1)
.Build().ToList();
@@ -209,7 +201,7 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
.With(p => p.Id = 1)
.Build();
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.All()
.With(c => c.MetadataProfileId = 2)
.Build().ToList();
@@ -14,7 +14,7 @@ namespace NzbDrone.Core.Test.Profiles
{
var profile = new QualityProfile
{
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_192, Quality.MP3_256),
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_320, Quality.MP3_320),
Cutoff = Quality.MP3_320.Id,
Name = "TestProfile"
};
@@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.Profiles
Subject.Handle(new ApplicationStartedEvent());
Mocker.GetMock<IProfileRepository>()
.Verify(v => v.Insert(It.IsAny<QualityProfile>()), Times.Exactly(3));
.Verify(v => v.Insert(It.IsAny<QualityProfile>()), Times.Exactly(4));
}
[Test]
@@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.Profiles
.With(p => p.Id = 2)
.Build();
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.Random(1)
.With(c => c.QualityProfileId = profile.Id)
.Build().ToList();
@@ -79,7 +79,7 @@ namespace NzbDrone.Core.Test.Profiles
.With(p => p.Id = 2)
.Build();
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.All()
.With(c => c.QualityProfileId = 1)
.Build().ToList();
@@ -111,7 +111,7 @@ namespace NzbDrone.Core.Test.Profiles
.With(p => p.Id = 2)
.Build();
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.All()
.With(c => c.QualityProfileId = 1)
.Build().ToList();
@@ -139,7 +139,7 @@ namespace NzbDrone.Core.Test.Profiles
[Test]
public void should_delete_profile_if_not_assigned_to_artist_import_list_or_root_folder()
{
var artistList = Builder<Artist>.CreateListOfSize(3)
var artistList = Builder<Author>.CreateListOfSize(3)
.All()
.With(c => c.QualityProfileId = 2)
.Build().ToList();
@@ -13,14 +13,14 @@ namespace NzbDrone.Core.Test.Profiles.Releases.PreferredWordService
[TestFixture]
public class CalculateFixture : CoreTest<Core.Profiles.Releases.PreferredWordService>
{
private Artist _artist = null;
private Author _artist = null;
private List<ReleaseProfile> _releaseProfiles = null;
private string _title = "Artist.Name-Album.Title.2018.FLAC.24bit-Readarr";
[SetUp]
public void Setup()
{
_artist = Builder<Artist>.CreateNew()
_artist = Builder<Author>.CreateNew()
.With(s => s.Tags = new HashSet<int>(new[] { 1, 2 }))
.Build();
@@ -13,14 +13,14 @@ namespace NzbDrone.Core.Test.Profiles.Releases.PreferredWordService
[TestFixture]
public class GetMatchingPreferredWordsFixture : CoreTest<Core.Profiles.Releases.PreferredWordService>
{
private Artist _artist = null;
private Author _artist = null;
private List<ReleaseProfile> _releaseProfiles = null;
private string _title = "Artist.Name-Album.Name-2018-Flac-Vinyl-Readarr";
[SetUp]
public void Setup()
{
_artist = Builder<Artist>.CreateNew()
_artist = Builder<Author>.CreateNew()
.With(s => s.Tags = new HashSet<int>(new[] { 1, 2 }))
.Build();