mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
Medium Support (Multi-disc Albums), Quality Grouping (#121)
* Multi Disc Stage 1 - Backend Work * Quality Group Functionality * Fixed: Only show wanted album types on ArtistDetail page * Add Media Count Column to ArtistDetail Page * Parser updates for multidisc cases, other usenet release title formats * Search for Tracks by Medium Number in Addition to Title and TrackNumber * Medium Renaming Token for Track Naming * fixup Codacy and Comment Cleanup * fixup remove comments
This commit is contained in:
@@ -20,7 +20,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
new Profile
|
||||
|
||||
{
|
||||
Cutoff = Quality.MP3_256,
|
||||
Cutoff = Quality.MP3_256.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new LanguageProfile
|
||||
@@ -37,7 +37,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Subject.CutoffNotMet(
|
||||
new Profile
|
||||
{
|
||||
Cutoff = Quality.MP3_256,
|
||||
Cutoff = Quality.MP3_256.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new LanguageProfile
|
||||
@@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
new Profile
|
||||
|
||||
{
|
||||
Cutoff = Quality.MP3_256,
|
||||
Cutoff = Quality.MP3_256.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new LanguageProfile
|
||||
@@ -73,7 +73,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
new Profile
|
||||
|
||||
{
|
||||
Cutoff = Quality.MP3_320,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new LanguageProfile
|
||||
@@ -93,7 +93,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
new Profile
|
||||
|
||||
{
|
||||
Cutoff = Quality.MP3_320,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new LanguageProfile
|
||||
@@ -111,7 +111,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Profile _profile = new Profile
|
||||
{
|
||||
Cutoff = Quality.MP3_320,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Profile _profile = new Profile
|
||||
{
|
||||
Cutoff = Quality.MP3_320,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Profile _profile = new Profile
|
||||
{
|
||||
Cutoff = Quality.MP3_320,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Profile _profile = new Profile
|
||||
{
|
||||
Cutoff = Quality.MP3_320,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Profile _profile = new Profile
|
||||
{
|
||||
Cutoff = Quality.MP3_320,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
};
|
||||
|
||||
_fakeArtist = Builder<Artist>.CreateNew()
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.MP3_512, Items = Qualities.QualityFixture.GetDefaultQualities() })
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.MP3_512.Id, Items = Qualities.QualityFixture.GetDefaultQualities() })
|
||||
.With(l => l.LanguageProfile = new LanguageProfile { Cutoff = Language.Spanish, Languages = LanguageFixture.GetDefaultLanguages() })
|
||||
.Build();
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_not_be_upgradable_if_album_is_of_same_quality_as_existing()
|
||||
{
|
||||
_fakeArtist.Profile = new Profile { Cutoff = Quality.MP3_512, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_fakeArtist.Profile = new Profile { Cutoff = Quality.MP3_512.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedAlbumInfo.Quality = new QualityModel(Quality.MP3_512, new Revision(version: 1));
|
||||
_upgradableQuality = new Tuple<QualityModel, Language>(new QualityModel(Quality.MP3_512, new Revision(version: 1)), Language.English);
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_not_be_upgradable_if_cutoff_already_met()
|
||||
{
|
||||
_fakeArtist.Profile = new Profile { Cutoff = Quality.MP3_512, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_fakeArtist.Profile = new Profile { Cutoff = Quality.MP3_512.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedAlbumInfo.Quality = new QualityModel(Quality.MP3_512, new Revision(version: 1));
|
||||
_upgradableQuality = new Tuple<QualityModel, Language>(new QualityModel(Quality.MP3_512, new Revision(version: 1)), Language.Spanish);
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_return_false_if_cutoff_already_met_and_cdh_is_disabled()
|
||||
{
|
||||
GivenCdhDisabled();
|
||||
_fakeArtist.Profile = new Profile { Cutoff = Quality.MP3_512, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_fakeArtist.Profile = new Profile { Cutoff = Quality.MP3_512.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedAlbumInfo.Quality = new QualityModel(Quality.MP3_512, new Revision(version: 1));
|
||||
_upgradableQuality = new Tuple<QualityModel, Language>(new QualityModel(Quality.MP3_512, new Revision(version: 1)), Language.Spanish);
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void Setup()
|
||||
{
|
||||
var fakeArtist = Builder<Artist>.CreateNew()
|
||||
.With(c => c.Profile = (LazyLoaded<Profile>)new Profile { Cutoff = Quality.MP3_512 })
|
||||
.With(c => c.Profile = (LazyLoaded<Profile>)new Profile { Cutoff = Quality.MP3_512.Id })
|
||||
.Build();
|
||||
|
||||
remoteAlbum = new RemoteAlbum
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
var profile = new Profile
|
||||
{
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
Cutoff = cutoff,
|
||||
Cutoff = cutoff.Id,
|
||||
};
|
||||
|
||||
var langProfile = new LanguageProfile
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_true_when_quality_in_queue_is_lower()
|
||||
{
|
||||
_artist.Profile.Value.Cutoff = Quality.MP3_512;
|
||||
_artist.Profile.Value.Cutoff = Quality.MP3_512.Id;
|
||||
_artist.LanguageProfile.Value.Cutoff = Language.Spanish;
|
||||
|
||||
var remoteAlbum = Builder<RemoteAlbum>.CreateNew()
|
||||
@@ -123,7 +123,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_true_when_quality_in_queue_is_lower_but_language_is_higher()
|
||||
{
|
||||
_artist.Profile.Value.Cutoff = Quality.FLAC;
|
||||
_artist.Profile.Value.Cutoff = Quality.FLAC.Id;
|
||||
_artist.LanguageProfile.Value.Cutoff = Language.Spanish;
|
||||
|
||||
var remoteAlbum = Builder<RemoteAlbum>.CreateNew()
|
||||
@@ -193,7 +193,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_when_quality_in_queue_is_better()
|
||||
{
|
||||
_artist.Profile.Value.Cutoff = Quality.MP3_512;
|
||||
_artist.Profile.Value.Cutoff = Quality.MP3_512.Id;
|
||||
|
||||
var remoteAlbum = Builder<RemoteAlbum>.CreateNew()
|
||||
.With(r => r.Artist = _artist)
|
||||
@@ -289,7 +289,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_if_quality_and_language_in_queue_meets_cutoff()
|
||||
{
|
||||
_artist.Profile.Value.Cutoff = _remoteAlbum.ParsedAlbumInfo.Quality.Quality;
|
||||
_artist.Profile.Value.Cutoff = _remoteAlbum.ParsedAlbumInfo.Quality.Quality.Id;
|
||||
|
||||
var remoteAlbum = Builder<RemoteAlbum>.CreateNew()
|
||||
.With(r => r.Artist = _artist)
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
_profile.Items.Add(new ProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 });
|
||||
_profile.Items.Add(new ProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 });
|
||||
|
||||
_profile.Cutoff = Quality.MP3_320;
|
||||
_profile.Cutoff = Quality.MP3_320.Id;
|
||||
|
||||
_langProfile.Cutoff = Language.Spanish;
|
||||
_langProfile.Languages = Languages.LanguageFixture.GetDefaultLanguages();
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
var secondTrack = new Track { TrackFile = _secondFile, TrackFileId = 2, AlbumId = 2 };
|
||||
|
||||
var fakeArtist = Builder<Artist>.CreateNew()
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.FLAC })
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.FLAC.Id })
|
||||
.With(c => c.Path = @"C:\Music\My.Artist".AsOsAgnostic())
|
||||
.Build();
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
|
||||
|
||||
var fakeArtist = Builder<Artist>.CreateNew()
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.FLAC })
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.FLAC.Id })
|
||||
.Build();
|
||||
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
var languages = Languages.LanguageFixture.GetDefaultLanguages(Language.English, Language.Spanish);
|
||||
|
||||
var fakeArtist = Builder<Artist>.CreateNew()
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.MP3_512, Items = Qualities.QualityFixture.GetDefaultQualities()})
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.MP3_512.Id, Items = Qualities.QualityFixture.GetDefaultQualities()})
|
||||
.With(l => l.LanguageProfile = new LanguageProfile { Cutoff = Language.Spanish, Languages = languages })
|
||||
.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user