Renamed Quality to QualityModel

pull/6/head
Mark McDowall 12 years ago
parent 410b4574bc
commit 49f086cf19

@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 3 };
parseResult.FullSeason = false;
parseResult.AirDate = null;
parseResult.Quality = new Quality(QualityTypes.HDTV, false);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, false);
parseResult.ToString().Should().Be("My Series - S12E03 HDTV");
@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 3 };
parseResult.FullSeason = false;
parseResult.AirDate = null;
parseResult.Quality = new Quality(QualityTypes.HDTV, true);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, true);
parseResult.ToString().Should().Be("My Series - S12E03 HDTV [proper]");
@ -51,7 +51,7 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 3, 4, 5 };
parseResult.FullSeason = false;
parseResult.AirDate = null;
parseResult.Quality = new Quality(QualityTypes.HDTV, false);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, false);
parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV");
@ -66,7 +66,7 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 3, 4, 5 };
parseResult.FullSeason = false;
parseResult.AirDate = null;
parseResult.Quality = new Quality(QualityTypes.HDTV, true);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, true);
parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV [proper]");
@ -81,7 +81,7 @@ namespace NzbDrone.Core.Test
parseResult.SeasonNumber = 12;
parseResult.FullSeason = true;
parseResult.AirDate = null;
parseResult.Quality = new Quality(QualityTypes.HDTV, false);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, false);
parseResult.ToString().Should().Be("My Series - Season 12 HDTV");
@ -96,7 +96,7 @@ namespace NzbDrone.Core.Test
parseResult.SeasonNumber = 12;
parseResult.FullSeason = true;
parseResult.AirDate = null;
parseResult.Quality = new Quality(QualityTypes.HDTV, true);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, true);
parseResult.ToString().Should().Be("My Series - Season 12 HDTV [proper]");
@ -110,7 +110,7 @@ namespace NzbDrone.Core.Test
parseResult.SeasonNumber = 12;
parseResult.FullSeason = true;
parseResult.AirDate = new DateTime(2010, 12, 30);
parseResult.Quality = new Quality(QualityTypes.HDTV, false);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, false);
parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV");
@ -124,7 +124,7 @@ namespace NzbDrone.Core.Test
parseResult.SeasonNumber = 12;
parseResult.FullSeason = true;
parseResult.AirDate = new DateTime(2010, 12, 30);
parseResult.Quality = new Quality(QualityTypes.HDTV, true);
parseResult.Quality = new QualityModel(QualityTypes.HDTV, true);
parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV [proper]");

@ -23,5 +23,8 @@
<NamedTestSelector>
<TestName>NzbDrone.Core.Test.Integeration.ServiceIntegerationFixture.should_be_able_to_submit_exceptions</TestName>
</NamedTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests.ImportFileFixture.import_unparsable_file_should_skip</TestName>
</NamedTestSelector>
</IgnoredTests>
</ProjectConfiguration>

@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
{
SeriesTitle = "Title",
Language = LanguageType.English,
Quality = new Quality(QualityTypes.SDTV, true),
Quality = new QualityModel(QualityTypes.SDTV, true),
EpisodeNumbers = new List<int> { 3, 4 },
SeasonNumber = 12,
AirDate = DateTime.Now.AddDays(-12).Date
@ -43,7 +43,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
{
SeriesTitle = "Title",
Language = LanguageType.English,
Quality = new Quality(QualityTypes.SDTV, true),
Quality = new QualityModel(QualityTypes.SDTV, true),
EpisodeNumbers = new List<int> { 3 },
SeasonNumber = 12,
AirDate = DateTime.Now.AddDays(-12).Date

@ -30,7 +30,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
{
SeriesTitle = "Title",
Language = LanguageType.English,
Quality = new Quality(QualityTypes.SDTV, true),
Quality = new QualityModel(QualityTypes.SDTV, true),
EpisodeNumbers = new List<int> { 3 },
SeasonNumber = 12,
AirDate = DateTime.Now.AddDays(-12).Date,

@ -35,7 +35,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
parseResult = new EpisodeParseResult
{
Series = fakeSeries,
Quality = new Quality(QualityTypes.DVD, true),
Quality = new QualityModel(QualityTypes.DVD, true),
EpisodeNumbers = new List<int> { 3 },
SeasonNumber = 12,
};

@ -24,7 +24,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
[TestCase(QualityTypes.SDTV, false, QualityTypes.SDTV, true, QualityTypes.SDTV, Result = true)]
public bool IsUpgradeTest(QualityTypes current, bool currentProper, QualityTypes newQuality, bool newProper, QualityTypes cutoff)
{
return new QualityUpgradeSpecification().IsSatisfiedBy(new Quality(current, currentProper), new Quality(newQuality, newProper), cutoff);
return new QualityUpgradeSpecification().IsSatisfiedBy(new QualityModel(current, currentProper), new QualityModel(newQuality, newProper), cutoff);
}
}
}

@ -38,7 +38,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
parseResultMulti = new EpisodeParseResult
{
Series = fakeSeries,
Quality = new Quality(QualityTypes.DVD, true),
Quality = new QualityModel(QualityTypes.DVD, true),
EpisodeNumbers = new List<int> { 3, 4 },
SeasonNumber = 12,
};
@ -46,7 +46,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
parseResultSingle = new EpisodeParseResult
{
Series = fakeSeries,
Quality = new Quality(QualityTypes.DVD, true),
Quality = new QualityModel(QualityTypes.DVD, true),
EpisodeNumbers = new List<int> { 3 },
SeasonNumber = 12,
};

@ -22,8 +22,8 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
private EpisodeParseResult parseResultMulti;
private EpisodeParseResult parseResultSingle;
private Quality firstQuality;
private Quality secondQuality;
private QualityModel firstQuality;
private QualityModel secondQuality;
[SetUp]
public void Setup()
@ -38,7 +38,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
parseResultMulti = new EpisodeParseResult
{
Series = fakeSeries,
Quality = new Quality(QualityTypes.DVD, true),
Quality = new QualityModel(QualityTypes.DVD, true),
EpisodeNumbers = new List<int> { 3, 4 },
SeasonNumber = 12,
};
@ -46,13 +46,13 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
parseResultSingle = new EpisodeParseResult
{
Series = fakeSeries,
Quality = new Quality(QualityTypes.DVD, true),
Quality = new QualityModel(QualityTypes.DVD, true),
EpisodeNumbers = new List<int> { 3 },
SeasonNumber = 12,
};
firstQuality = new Quality(QualityTypes.Bluray1080p, true);
secondQuality = new Quality(QualityTypes.Bluray1080p, true);
firstQuality = new QualityModel(QualityTypes.Bluray1080p, true);
secondQuality = new QualityModel(QualityTypes.Bluray1080p, true);
var singleEpisodeList = new List<Episode> { new Episode { SeasonNumber = 12, EpisodeNumber = 3 } };
var doubleEpisodeList = new List<Episode> {
@ -66,7 +66,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
Mocker.GetMock<HistoryProvider>().Setup(c => c.GetBestQualityInHistory(fakeSeries.SeriesId, 12, 3)).Returns(firstQuality);
Mocker.GetMock<HistoryProvider>().Setup(c => c.GetBestQualityInHistory(fakeSeries.SeriesId, 12, 4)).Returns(secondQuality);
Mocker.GetMock<HistoryProvider>().Setup(c => c.GetBestQualityInHistory(fakeSeries.SeriesId, 12, 5)).Returns<Quality>(null);
Mocker.GetMock<HistoryProvider>().Setup(c => c.GetBestQualityInHistory(fakeSeries.SeriesId, 12, 5)).Returns<QualityModel>(null);
}
private void WithFirstReportUpgradable()

@ -112,7 +112,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
.Returns(fi);
Mocker.GetMock<DownloadProvider>()
.Setup(s => s.GetDownloadTitle(It.Is<EpisodeParseResult>(e => e.Quality == new Quality{ QualityType = QualityTypes.WEBDL, Proper = false })))
.Setup(s => s.GetDownloadTitle(It.Is<EpisodeParseResult>(e => e.Quality == new QualityModel{ QualityType = QualityTypes.WEBDL, Proper = false })))
.Returns(message);
Mocker.GetMock<ExternalNotificationProvider>()

@ -128,7 +128,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
EpisodeTitle = "Title",
EpisodeNumbers = new List<int> { 5 },
SeasonNumber = 1,
Quality = new Quality { QualityType = QualityTypes.SDTV, Proper = false },
Quality = new QualityModel { QualityType = QualityTypes.SDTV, Proper = false },
Series = new Series { Title = "30 Rock", CleanTitle = Parser.NormalizeTitle("30 Rock") },
};
@ -145,7 +145,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
var parseResult = new EpisodeParseResult
{
Quality = new Quality { QualityType = QualityTypes.Bluray720p, Proper = false },
Quality = new QualityModel { QualityType = QualityTypes.Bluray720p, Proper = false },
AirDate = new DateTime(2011, 12, 01),
Series = new Series { Title = "The Dailyshow", CleanTitle = Parser.NormalizeTitle("The Dailyshow"), IsDaily = true },
};
@ -164,7 +164,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
var parseResult = new EpisodeParseResult
{
Quality = new Quality { QualityType = QualityTypes.Bluray720p, Proper = false },
Quality = new QualityModel { QualityType = QualityTypes.Bluray720p, Proper = false },
FullSeason = true,
SeasonNumber = 5,
Series = new Series { Title = "My Name is earl", CleanTitle = Parser.NormalizeTitle("My Name is earl") },
@ -191,7 +191,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
EpisodeTitle = "Title",
EpisodeNumbers = new List<int>(episodes),
SeasonNumber = season,
Quality = new Quality { QualityType = qualityType, Proper = proper },
Quality = new QualityModel { QualityType = qualityType, Proper = proper },
Series = new Series { Title = title, CleanTitle = Parser.NormalizeTitle(title) },
};
@ -215,7 +215,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
EpisodeTitle = "Title",
EpisodeNumbers = new List<int>(episodes),
SeasonNumber = season,
Quality = new Quality { QualityType = qualityType, Proper = proper },
Quality = new QualityModel { QualityType = qualityType, Proper = proper },
Series = new Series { Title = title, CleanTitle = Parser.NormalizeTitle(title) },
};
@ -237,7 +237,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
EpisodeTitle = "Title",
EpisodeNumbers = new List<int>(episodes),
SeasonNumber = season,
Quality = new Quality { QualityType = qualityType, Proper = proper },
Quality = new QualityModel { QualityType = qualityType, Proper = proper },
Series = new Series { Title = title, CleanTitle = Parser.NormalizeTitle(title) },
};
@ -259,7 +259,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
EpisodeTitle = "Title",
EpisodeNumbers = new List<int>(episodes),
SeasonNumber = season,
Quality = new Quality { QualityType = qualityType, Proper = proper },
Quality = new QualityModel { QualityType = qualityType, Proper = proper },
Series = new Series { Title = title, CleanTitle = Parser.NormalizeTitle(title) },
};
@ -278,7 +278,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
EpisodeTitle = "Title",
EpisodeNumbers = new List<int> { 1 },
SeasonNumber = 2,
Quality = new Quality { QualityType = QualityTypes.Bluray1080p, Proper = true },
Quality = new QualityModel { QualityType = QualityTypes.Bluray1080p, Proper = true },
Series = new Series { Title = "Test", CleanTitle = Parser.NormalizeTitle("Test") },
};

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test.ProviderTests
.Setup(c => c.GetEpisodesByParseResult(It.IsAny<EpisodeParseResult>())).Returns(episodes);
return Builder<EpisodeParseResult>.CreateNew()
.With(c => c.Quality = new Quality(QualityTypes.DVD, false))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, false))
.With(c => c.Series = Builder<Series>.CreateNew().Build())
.With(c => c.EpisodeNumbers = new List<int>{2})
.Build();
@ -195,7 +195,7 @@ namespace NzbDrone.Core.Test.ProviderTests
{
AirDate = DateTime.Now,
EpisodeNumbers = episodes.ToList(),
Quality = new Quality(quality, proper),
Quality = new QualityModel(quality, proper),
SeasonNumber = seasons,
Series = series,
EpisodeTitle = title
@ -215,7 +215,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var parsResult = new EpisodeParseResult()
{
AirDate = DateTime.Now,
Quality = new Quality(QualityTypes.Bluray720p, proper),
Quality = new QualityModel(QualityTypes.Bluray720p, proper),
SeasonNumber = 1,
Series = series,
EpisodeTitle = "My Episode Title",
@ -237,7 +237,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var parsResult = new EpisodeParseResult
{
AirDate = new DateTime(2011, 12, 1),
Quality = new Quality(QualityTypes.Bluray720p, proper),
Quality = new QualityModel(QualityTypes.Bluray720p, proper),
Series = series,
EpisodeTitle = "My Episode Title",
};

@ -93,9 +93,9 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All()
.With(c => c.AirDate = DateTime.Today)
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.Random(1)
.With(c => c.Quality = new Quality(QualityTypes.Bluray1080p, true))
.With(c => c.Quality = new QualityModel(QualityTypes.Bluray1080p, true))
.Build();
WithMatchingSeries();
@ -123,7 +123,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All()
.With(c => c.AirDate = DateTime.Today)
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.Build();
WithMatchingSeries();
@ -147,7 +147,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All()
.With(e => e.AirDate = DateTime.Today)
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithNullSeries();
@ -168,7 +168,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All()
.With(e => e.AirDate = DateTime.Today)
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithMisMatchedSeries();
@ -189,7 +189,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(2)
.All()
.With(e => e.AirDate = DateTime.Today)
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.Build();
WithMatchingSeries();
@ -212,9 +212,9 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(2)
.All()
.With(e => e.AirDate = DateTime.Today)
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.TheLast(1)
.With(c => c.Quality = new Quality(QualityTypes.SDTV, true))
.With(c => c.Quality = new QualityModel(QualityTypes.SDTV, true))
.Build();
WithMatchingSeries();
@ -244,7 +244,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All()
.With(e => e.AirDate = null)
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithMatchingSeries();
@ -265,7 +265,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
var parseResults = Builder<EpisodeParseResult>.CreateListOfSize(5)
.All()
.With(e => e.AirDate = DateTime.Today.AddDays(10))
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithMatchingSeries();

@ -91,10 +91,10 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.With(c => c.Age = 10)
.Random(1)
.With(c => c.Quality = new Quality(QualityTypes.Bluray1080p, true))
.With(c => c.Quality = new QualityModel(QualityTypes.Bluray1080p, true))
.With(c => c.Age = 100)
.Build();
@ -125,7 +125,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(c => c.Quality = new Quality(QualityTypes.Bluray1080p, true))
.With(c => c.Quality = new QualityModel(QualityTypes.Bluray1080p, true))
.With(c => c.Age = 300)
.Build();
@ -157,7 +157,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.Build();
WithMatchingSeries();
@ -183,7 +183,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithNullSeries();
@ -206,7 +206,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithMisMatchedSeries();
@ -229,7 +229,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 2)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithMatchingSeries();
@ -252,7 +252,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 2 })
.With(e => e.Quality = new Quality(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false))
.Build();
WithMatchingSeries();
@ -275,7 +275,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 5 })
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.TheLast(1)
.With(e => e.EpisodeNumbers = new List<int> { 1, 2, 3, 4, 5 })
.Build();
@ -302,9 +302,9 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.TheLast(1)
.With(c => c.Quality = new Quality(QualityTypes.SDTV, true))
.With(c => c.Quality = new QualityModel(QualityTypes.SDTV, true))
.Build();
WithMatchingSeries();
@ -336,10 +336,10 @@ namespace NzbDrone.Core.Test.ProviderTests.SearchProviderTests
.All()
.With(e => e.SeasonNumber = 1)
.With(e => e.EpisodeNumbers = new List<int> { 1 })
.With(c => c.Quality = new Quality(QualityTypes.DVD, true))
.With(c => c.Quality = new QualityModel(QualityTypes.DVD, true))
.With(c => c.Age = 10)
.Random(1)
.With(c => c.Quality = new Quality(QualityTypes.Bluray1080p, true))
.With(c => c.Quality = new QualityModel(QualityTypes.Bluray1080p, true))
.With(c => c.Age = 100)
.Build();

@ -13,8 +13,8 @@ namespace NzbDrone.Core.Test
[Test]
public void Icomparer_greater_test()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
second.Should().BeGreaterThan(first);
}
@ -22,8 +22,8 @@ namespace NzbDrone.Core.Test
[Test]
public void Icomparer_greater_proper()
{
var first = new Quality(QualityTypes.Bluray1080p, false);
var second = new Quality(QualityTypes.Bluray1080p, true);
var first = new QualityModel(QualityTypes.Bluray1080p, false);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
second.Should().BeGreaterThan(first);
}
@ -31,8 +31,8 @@ namespace NzbDrone.Core.Test
[Test]
public void Icomparer_lesser()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
first.Should().BeLessThan(second);
}
@ -40,8 +40,8 @@ namespace NzbDrone.Core.Test
[Test]
public void Icomparer_lesser_proper()
{
var first = new Quality(QualityTypes.DVD, false);
var second = new Quality(QualityTypes.DVD, true);
var first = new QualityModel(QualityTypes.DVD, false);
var second = new QualityModel(QualityTypes.DVD, true);
first.Should().BeLessThan(second);
}
@ -49,8 +49,8 @@ namespace NzbDrone.Core.Test
[Test]
public void equal_operand()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(first == second).Should().BeTrue();
(first >= second).Should().BeTrue();
@ -60,8 +60,8 @@ namespace NzbDrone.Core.Test
[Test]
public void equal_operand_false()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Unknown, true);
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Unknown, true);
(first == second).Should().BeFalse();
}
@ -69,8 +69,8 @@ namespace NzbDrone.Core.Test
[Test]
public void equal_operand_false_proper()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, false);
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, false);
(first == second).Should().BeFalse();
}
@ -79,8 +79,8 @@ namespace NzbDrone.Core.Test
[Test]
public void not_equal_operand()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(first != second).Should().BeFalse();
}
@ -88,8 +88,8 @@ namespace NzbDrone.Core.Test
[Test]
public void not_equal_operand_false()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Unknown, true);
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Unknown, true);
(first != second).Should().BeTrue();
}
@ -97,8 +97,8 @@ namespace NzbDrone.Core.Test
[Test]
public void not_equal_operand_false_proper()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, false);
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, false);
(first != second).Should().BeTrue();
}
@ -106,8 +106,8 @@ namespace NzbDrone.Core.Test
[Test]
public void greater_operand()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(first < second).Should().BeTrue();
(first <= second).Should().BeTrue();
@ -116,8 +116,8 @@ namespace NzbDrone.Core.Test
[Test]
public void lesser_operand()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(second > first).Should().BeTrue();
(second >= first).Should().BeTrue();

@ -24,7 +24,7 @@ namespace NzbDrone.Core.Model
public DateTime? AirDate { get; set; }
public Quality Quality { get; set; }
public QualityModel Quality { get; set; }
public LanguageType Language { get; set; }

@ -3,21 +3,21 @@ using NzbDrone.Core.Repository.Quality;
namespace NzbDrone.Core.Model
{
public class Quality : IComparable<Quality>
public class QualityModel : IComparable<QualityModel>
{
public QualityTypes QualityType { get; set; }
public Boolean Proper { get; set; }
public Quality() { }
public QualityModel() { }
public Quality(QualityTypes quality, Boolean proper)
public QualityModel(QualityTypes quality, Boolean proper)
{
QualityType = quality;
Proper = proper;
}
public int CompareTo(Quality other)
public int CompareTo(QualityModel other)
{
if (other.QualityType > QualityType)
return -1;
@ -37,12 +37,12 @@ namespace NzbDrone.Core.Model
return 0;
}
public static bool operator !=(Quality x, Quality y)
public static bool operator !=(QualityModel x, QualityModel y)
{
return !(x == y);
}
public static bool operator ==(Quality x, Quality y)
public static bool operator ==(QualityModel x, QualityModel y)
{
var xObj = (Object)x;
var yObj = (object)y;
@ -55,22 +55,22 @@ namespace NzbDrone.Core.Model
return x.CompareTo(y) == 0;
}
public static bool operator >(Quality x, Quality y)
public static bool operator >(QualityModel x, QualityModel y)
{
return x.CompareTo(y) > 0;
}
public static bool operator <(Quality x, Quality y)
public static bool operator <(QualityModel x, QualityModel y)
{
return x.CompareTo(y) < 1;
}
public static bool operator <=(Quality x, Quality y)
public static bool operator <=(QualityModel x, QualityModel y)
{
return x.CompareTo(y) <= 0;
}
public static bool operator >=(Quality x, Quality y)
public static bool operator >=(QualityModel x, QualityModel y)
{
return x.CompareTo(y) >= 0;
}
@ -97,7 +97,7 @@ namespace NzbDrone.Core.Model
}
}
public bool Equals(Quality other)
public bool Equals(QualityModel other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
@ -108,8 +108,8 @@ namespace NzbDrone.Core.Model
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != typeof (Quality)) return false;
return Equals((Quality) obj);
if (obj.GetType() != typeof (QualityModel)) return false;
return Equals((QualityModel) obj);
}
}
}

@ -6,7 +6,7 @@
internal int SeasonNumber { get; set; }
internal int Year { get; set; }
public Quality Quality { get; set; }
public QualityModel Quality { get; set; }
public override string ToString()
{

@ -245,13 +245,13 @@ namespace NzbDrone.Core
return NormalizeTitle(title);
}
internal static Quality ParseQuality(string name)
internal static QualityModel ParseQuality(string name)
{
Logger.Trace("Trying to parse quality for {0}", name);
name = name.Trim();
var normalizedName = NormalizeTitle(name);
var result = new Quality { QualityType = QualityTypes.Unknown };
var result = new QualityModel { QualityType = QualityTypes.Unknown };
result.Proper = (normalizedName.Contains("proper") || normalizedName.Contains("repack"));
if (normalizedName.Contains("dvd") || normalizedName.Contains("bdrip") || normalizedName.Contains("brrip"))

@ -9,7 +9,7 @@ namespace NzbDrone.Core.Providers.DecisionEngine
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public virtual bool IsSatisfiedBy(Quality currentQuality, Quality newQuality, QualityTypes cutOff)
public virtual bool IsSatisfiedBy(QualityModel currentQuality, QualityModel newQuality, QualityTypes cutOff)
{
if (currentQuality >= newQuality)
{

@ -27,7 +27,7 @@ namespace NzbDrone.Core.Providers.DecisionEngine
foreach (var file in _episodeProvider.GetEpisodesByParseResult(subject).Select(c => c.EpisodeFile).Where(c => c != null))
{
logger.Trace("Comparing file quality with report. Existing file is {0} proper:{1}", file.Quality, file.Proper);
if (!_qualityUpgradeSpecification.IsSatisfiedBy(new Quality { QualityType = file.Quality, Proper = file.Proper }, subject.Quality, subject.Series.QualityProfile.Cutoff))
if (!_qualityUpgradeSpecification.IsSatisfiedBy(new QualityModel { QualityType = file.Quality, Proper = file.Proper }, subject.Quality, subject.Series.QualityProfile.Cutoff))
return false;
}

@ -202,7 +202,7 @@ namespace NzbDrone.Core.Providers
var parseResult = Parser.ParsePath(episodeFile.Path);
parseResult.Series = series;
parseResult.Quality = new Quality{ QualityType = episodeFile.Quality, Proper = episodeFile.Proper };
parseResult.Quality = new QualityModel{ QualityType = episodeFile.Quality, Proper = episodeFile.Proper };
var message = _downloadProvider.GetDownloadTitle(parseResult);

@ -60,7 +60,7 @@ namespace NzbDrone.Core.Providers
logger.Debug("Item added to history: {0}", item.NzbTitle);
}
public virtual Quality GetBestQualityInHistory(int seriesId, int seasonNumber, int episodeNumber)
public virtual QualityModel GetBestQualityInHistory(int seriesId, int seasonNumber, int episodeNumber)
{
var quality = _database.SingleOrDefault<dynamic>(@"SELECT TOP 1 History.Quality , History.IsProper FROM History
INNER JOIN Episodes ON History.EpisodeId = Episodes.EpisodeId
@ -72,7 +72,7 @@ namespace NzbDrone.Core.Providers
if (quality == null) return null;
return new Quality((QualityTypes)quality.Quality, quality.IsProper);
return new QualityModel((QualityTypes)quality.Quality, quality.IsProper);
}
public virtual void Delete(int historyId)

@ -16,7 +16,7 @@ namespace NzbDrone.Core.Providers
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public virtual void UpdateEpisodeStatus(int episodeId, EpisodeStatusType episodeStatus, Quality quality)
public virtual void UpdateEpisodeStatus(int episodeId, EpisodeStatusType episodeStatus, QualityModel quality)
{
try
{

@ -38,11 +38,11 @@ namespace NzbDrone.Core.Repository
public string ReleaseGroup { get; set; }
[Ignore]
public Model.Quality QualityWrapper
public Model.QualityModel QualityWrapper
{
get
{
return new Model.Quality(Quality, Proper);
return new Model.QualityModel(Quality, Proper);
}
set
{

Loading…
Cancel
Save