diff --git a/NzbDrone.Core.Test/EpisodeParseResultTest.cs b/NzbDrone.Core.Test/EpisodeParseResultTest.cs index 7cb6ac847..3f9d2253a 100644 --- a/NzbDrone.Core.Test/EpisodeParseResultTest.cs +++ b/NzbDrone.Core.Test/EpisodeParseResultTest.cs @@ -21,10 +21,10 @@ public void tostring_single_season_episode() parseResult.EpisodeNumbers = new List { 3 }; parseResult.FullSeason = false; parseResult.AirDate = null; - parseResult.Quality = new QualityModel(QualityTypes.HDTV, false); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false); - parseResult.ToString().Should().Be("My Series - S12E03 HDTV"); + parseResult.ToString().Should().Be("My Series - S12E03 HDTV-720p"); } [Test] @@ -36,10 +36,10 @@ public void tostring_single_season_episode_proper() parseResult.EpisodeNumbers = new List { 3 }; parseResult.FullSeason = false; parseResult.AirDate = null; - parseResult.Quality = new QualityModel(QualityTypes.HDTV, true); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true); - parseResult.ToString().Should().Be("My Series - S12E03 HDTV [proper]"); + parseResult.ToString().Should().Be("My Series - S12E03 HDTV-720p [proper]"); } [Test] @@ -51,10 +51,10 @@ public void tostring_multi_season_episode() parseResult.EpisodeNumbers = new List { 3, 4, 5 }; parseResult.FullSeason = false; parseResult.AirDate = null; - parseResult.Quality = new QualityModel(QualityTypes.HDTV, false); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false); - parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV"); + parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV-720p"); } [Test] @@ -66,10 +66,10 @@ public void tostring_multi_season_episode_proper() parseResult.EpisodeNumbers = new List { 3, 4, 5 }; parseResult.FullSeason = false; parseResult.AirDate = null; - parseResult.Quality = new QualityModel(QualityTypes.HDTV, true); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true); - parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV [proper]"); + parseResult.ToString().Should().Be("My Series - S12E03-04-05 HDTV-720p [proper]"); } @@ -81,10 +81,10 @@ public void tostring_full_season() parseResult.SeasonNumber = 12; parseResult.FullSeason = true; parseResult.AirDate = null; - parseResult.Quality = new QualityModel(QualityTypes.HDTV, false); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false); - parseResult.ToString().Should().Be("My Series - Season 12 HDTV"); + parseResult.ToString().Should().Be("My Series - Season 12 HDTV-720p"); } @@ -96,10 +96,10 @@ public void tostring_full_season_proper() parseResult.SeasonNumber = 12; parseResult.FullSeason = true; parseResult.AirDate = null; - parseResult.Quality = new QualityModel(QualityTypes.HDTV, true); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true); - parseResult.ToString().Should().Be("My Series - Season 12 HDTV [proper]"); + parseResult.ToString().Should().Be("My Series - Season 12 HDTV-720p [proper]"); } [Test] @@ -110,10 +110,10 @@ public void tostring_daily_show() parseResult.SeasonNumber = 12; parseResult.FullSeason = true; parseResult.AirDate = new DateTime(2010, 12, 30); - parseResult.Quality = new QualityModel(QualityTypes.HDTV, false); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, false); - parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV"); + parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV-720p"); } [Test] @@ -124,10 +124,10 @@ public void tostring_daily_show_proper() parseResult.SeasonNumber = 12; parseResult.FullSeason = true; parseResult.AirDate = new DateTime(2010, 12, 30); - parseResult.Quality = new QualityModel(QualityTypes.HDTV, true); + parseResult.Quality = new QualityModel(QualityTypes.HDTV720p, true); - parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV [proper]"); + parseResult.ToString().Should().Be("My Series - 2010-12-30 HDTV-720p [proper]"); } } diff --git a/NzbDrone.Core.Test/Files/History.txt b/NzbDrone.Core.Test/Files/History.txt index 118d554b8..6d13ffe42 100644 --- a/NzbDrone.Core.Test/Files/History.txt +++ b/NzbDrone.Core.Test/Files/History.txt @@ -22,16 +22,16 @@ "script":"None", "nzb_name":"The.Mentalist.S04E12.720p.HDTV.x264-IMMERSE.nzb", "download_time":524, - "storage":"C:\\ServerPool\\ServerFolders\\Unsorted TV\\The Mentalist - 4x12 - My Bloody Valentine [HDTV]", + "storage":"C:\\ServerPool\\ServerFolders\\Unsorted TV\\The Mentalist - 4x12 - My Bloody Valentine [HDTV-720p]", "status":"Completed", "script_line":"", "completed":1327033479, "nzo_id":"SABnzbd_nzo_0crgis", "downloaded":1016942445, "report":"", - "path":"D:\\SABnzbd\\downloading\\The Mentalist - 4x12 - My Bloody Valentine [HDTV]", + "path":"D:\\SABnzbd\\downloading\\The Mentalist - 4x12 - My Bloody Valentine [HDTV-720p]", "postproc_time":24, - "name":"The Mentalist - 4x12 - My Bloody Valentine [HDTV]", + "name":"The Mentalist - 4x12 - My Bloody Valentine [HDTV-720p]", "url":"", "bytes":1016942445, "url_info":"", diff --git a/NzbDrone.Core.Test/Files/Queue.txt b/NzbDrone.Core.Test/Files/Queue.txt index 4d8fdaa6c..452b2806d 100644 --- a/NzbDrone.Core.Test/Files/Queue.txt +++ b/NzbDrone.Core.Test/Files/Queue.txt @@ -54,7 +54,7 @@ "avg_age":"149d", "cat":"tv", "eta":"06:55 AM Sat 21 Jan", - "filename":"30 Rock - 1x05 - Title [HDTV]", + "filename":"30 Rock - 1x05 - Title [HDTV-720p]", "index":0, "mb":"267.44", "mbleft":"238.66", @@ -187,7 +187,7 @@ "verbosity":"", "mb":"546.13", "sizeleft":"546 MB", - "filename":"DUPLICATE / The Big Bang Theory - 5x13 - The Recombination Hypothesis [HDTV] [Proper]", + "filename":"DUPLICATE / The Big Bang Theory - 5x13 - The Recombination Hypothesis [HDTV-720p] [Proper]", "priority":"Normal", "cat":"tv", "mbleft":"546.13", diff --git a/NzbDrone.Core.Test/Files/QueueUnknownPriority.txt b/NzbDrone.Core.Test/Files/QueueUnknownPriority.txt index 0d0c18abd..5ae22e076 100644 --- a/NzbDrone.Core.Test/Files/QueueUnknownPriority.txt +++ b/NzbDrone.Core.Test/Files/QueueUnknownPriority.txt @@ -54,7 +54,7 @@ "avg_age":"149d", "cat":"tv", "eta":"06:55 AM Sat 21 Jan", - "filename":"30 Rock - 1x05 - Title [HDTV]", + "filename":"30 Rock - 1x05 - Title [HDTV-720p]", "index":0, "mb":"267.44", "mbleft":"238.66", @@ -187,7 +187,7 @@ "verbosity":"", "mb":"546.13", "sizeleft":"546 MB", - "filename":"DUPLICATE / The Big Bang Theory - 5x13 - The Recombination Hypothesis [HDTV] [Proper]", + "filename":"DUPLICATE / The Big Bang Theory - 5x13 - The Recombination Hypothesis [HDTV-720p] [Proper]", "priority":"NotReal", "cat":"tv", "mbleft":"546.13", diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index 078ff485b..956819537 100644 --- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -158,7 +158,7 @@ - + @@ -245,7 +245,7 @@ - + diff --git a/NzbDrone.Core.Test/ParserFixture/ParserTest.cs b/NzbDrone.Core.Test/ParserTests/ParserFixture.cs similarity index 97% rename from NzbDrone.Core.Test/ParserFixture/ParserTest.cs rename to NzbDrone.Core.Test/ParserTests/ParserFixture.cs index bcf9c54ed..ccf1c70d4 100644 --- a/NzbDrone.Core.Test/ParserFixture/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -1,28 +1,27 @@ // ReSharper disable RedundantUsingDirective + using System; using System.Linq; using FluentAssertions; using Moq; using NUnit.Framework; -using NzbDrone.Common; using NzbDrone.Common.Contract; using NzbDrone.Core.Model; -using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; using NzbDrone.Test.Common; -namespace NzbDrone.Core.Test.ParserFixture +namespace NzbDrone.Core.Test.ParserTests { // ReSharper disable InconsistentNaming [TestFixture] - public class ParserTest : CoreTest + public class ParserFixture : CoreTest { /*Fucked-up hall of shame, * WWE.Wrestlemania.27.PPV.HDTV.XviD-KYR * Unreported.World.Chinas.Lost.Sons.WS.PDTV.XviD-FTP * [TestCase("Big Time Rush 1x01 to 10 480i DD2 0 Sianto", "Big Time Rush", 1, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, 10)] - * [TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "Desparate Housewives", 7, new[] { 22, 23 }, 2)] - * [TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "", 7, new[] { 22, 23 }, 2)] + * [TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "Desparate Housewives", 7, new[] { 22, 23 }, 2)] + * [TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "", 7, new[] { 22, 23 }, 2)] */ [TestCase("Sonny.With.a.Chance.S02E15", "Sonny.With.a.Chance", 2, 15)] @@ -68,7 +67,7 @@ public class ParserTest : CoreTest [TestCase("hawaii.five-0.2010.217.hdtv-lol", "Hawaii Five-0 (2010)", 2, 17)] [TestCase("Looney Tunes - S1936E18 - I Love to Singa", "Looney Tunes", 1936, 18)] [TestCase("American_Dad!_-_7x6_-_The_Scarlett_Getter_[SDTV]", "American Dad!", 7, 6)] - [TestCase("Falling_Skies_-_1x1_-_Live_and_Learn_[HDTV]", "Falling Skies", 1, 1)] + [TestCase("Falling_Skies_-_1x1_-_Live_and_Learn_[HDTV-720p]", "Falling Skies", 1, 1)] [TestCase("Top Gear - 07x03 - 2005.11.70", "Top Gear", 7, 3)] [TestCase("Hatfields and McCoys 2012 Part 1 REPACK 720p HDTV x264 2HD", "Hatfields and McCoys 2012", 1, 1)] [TestCase("Glee.S04E09.Swan.Song.1080p.WEB-DL.DD5.1.H.264-ECI", "Glee", 4, 9)] @@ -138,10 +137,10 @@ public void unparsable_title_should_report_title() [TestCase("The Borgias S01e01 e02 ShoHD On Demand 1080i DD5 1 ALANiS", "The Borgias", 1, new[] { 1, 2 })] [TestCase("White.Collar.2x04.2x05.720p.BluRay-FUTV", "White.Collar", 2, new[] { 4, 5 })] [TestCase("Desperate.Housewives.S07E22E23.720p.HDTV.X264-DIMENSION", "Desperate.Housewives", 7, new[] { 22, 23 })] - [TestCase("Desparate Housewives - S07E22 - S07E23 - And Lots of Security.. [HDTV].mkv", "Desparate Housewives", 7, new[] { 22, 23 })] + [TestCase("Desparate Housewives - S07E22 - S07E23 - And Lots of Security.. [HDTV-720p].mkv", "Desparate Housewives", 7, new[] { 22, 23 })] [TestCase("S03E01.S03E02.720p.HDTV.X264-DIMENSION", "", 3, new[] { 1, 2 })] - [TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "Desparate Housewives", 7, new[] { 22, 23 })] - [TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "", 7, new[] { 22, 23 })] + [TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "Desparate Housewives", 7, new[] { 22, 23 })] + [TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "", 7, new[] { 22, 23 })] [TestCase("2x04x05.720p.BluRay-FUTV", "", 2, new[] { 4, 5 })] [TestCase("S02E04E05.720p.BluRay-FUTV", "", 2, new[] { 4, 5 })] [TestCase("S02E03-04-05.720p.BluRay-FUTV", "", 2, new[] { 3,4,5 })] diff --git a/NzbDrone.Core.Test/ParserFixture/QualityParserTests.cs b/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs similarity index 85% rename from NzbDrone.Core.Test/ParserFixture/QualityParserTests.cs rename to NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 69c42b8c8..4d7368d98 100644 --- a/NzbDrone.Core.Test/ParserFixture/QualityParserTests.cs +++ b/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -1,28 +1,24 @@ // ReSharper disable RedundantUsingDirective + using System; using System.Linq; using FluentAssertions; -using Moq; using NUnit.Framework; -using NzbDrone.Common; -using NzbDrone.Common.Contract; -using NzbDrone.Core.Model; using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; -using NzbDrone.Test.Common; -namespace NzbDrone.Core.Test.ParserFixture +namespace NzbDrone.Core.Test.ParserTests { [TestFixture] // ReSharper disable InconsistentNaming - public class QualityParserTests : CoreTest + public class QualityParserFixture : CoreTest { public static object[] QualityParserCases = { new object[] { "WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD, false }, new object[] { "WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD, false }, new object[] { "WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD, false }, - new object[] { "Two.and.a.Half.Men.S08E05.720p.HDTV.X264-DIMENSION", QualityTypes.HDTV, false }, + new object[] { "Two.and.a.Half.Men.S08E05.720p.HDTV.X264-DIMENSION", QualityTypes.HDTV720p, false }, new object[] { "this has no extention or periods HDTV", QualityTypes.SDTV, false }, new object[] { "Chuck.S04E05.HDTV.XviD-LOL", QualityTypes.SDTV, false }, new object[] { "The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", QualityTypes.DVD, false }, @@ -30,14 +26,14 @@ public class QualityParserTests : CoreTest new object[] { "The.Girls.Next.Door.S03E06.HDTV-WiDE", QualityTypes.SDTV, false }, new object[] { "Degrassi.S10E27.WS.DSR.XviD-2HD", QualityTypes.SDTV, false }, new object[] { "Sonny.With.a.Chance.S02E15.720p.WEB-DL.DD5.1.H.264-SURFER", QualityTypes.WEBDL720p, false }, - new object[] { "Sonny.With.a.Chance.S02E15.720p", QualityTypes.HDTV, false }, - new object[] { "Sonny.With.a.Chance.S02E15.mkv", QualityTypes.HDTV, false }, + new object[] { "Sonny.With.a.Chance.S02E15.720p", QualityTypes.HDTV720p, false }, + new object[] { "Sonny.With.a.Chance.S02E15.mkv", QualityTypes.HDTV720p, false }, new object[] { "Sonny.With.a.Chance.S02E15.avi", QualityTypes.SDTV, false }, new object[] { "Sonny.With.a.Chance.S02E15.xvid", QualityTypes.SDTV, false }, new object[] { "Sonny.With.a.Chance.S02E15.divx", QualityTypes.SDTV, false }, new object[] { "Sonny.With.a.Chance.S02E15", QualityTypes.Unknown, false }, - new object[] { "Chuck - S01E04 - So Old - Playdate - 720p TV.mkv", QualityTypes.HDTV, false }, - new object[] { "Chuck - S22E03 - MoneyBART - HD TV.mkv", QualityTypes.HDTV, false }, + new object[] { "Chuck - S01E04 - So Old - Playdate - 720p TV.mkv", QualityTypes.HDTV720p, false }, + new object[] { "Chuck - S22E03 - MoneyBART - HD TV.mkv", QualityTypes.HDTV720p, false }, new object[] { "Chuck - S01E03 - Come Fly With Me - 720p BluRay.mkv", QualityTypes.Bluray720p, false }, new object[] { "Chuck - S01E03 - Come Fly With Me - 1080p BluRay.mkv", QualityTypes.Bluray1080p, false }, new object[] { "Chuck - S11E06 - D-Yikes! - 720p WEB-DL.mkv", QualityTypes.WEBDL720p, false }, @@ -45,9 +41,9 @@ public class QualityParserTests : CoreTest new object[] { "WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi", QualityTypes.DVD, false }, new object[] { "Law & Order: Special Victims Unit - 11x11 - Quickie", QualityTypes.Unknown, false }, new object[] { "(NZB)", QualityTypes.Unknown, false }, - new object[] { "S07E23 - [HDTV].mkv ", QualityTypes.HDTV, false }, + new object[] { "S07E23 - [HDTV-720p].mkv ", QualityTypes.HDTV720p, false }, new object[] { "S07E23 - [WEBDL].mkv ", QualityTypes.WEBDL720p, false }, - new object[] { "S07E23.mkv ", QualityTypes.HDTV, false }, + new object[] { "S07E23.mkv ", QualityTypes.HDTV720p, false }, new object[] { "S07E23 .avi ", QualityTypes.SDTV, false }, new object[] { "WEEDS.S03E01-06.DUAL.XviD.Bluray.AC3.-HELLYWOOD.avi", QualityTypes.DVD, false }, new object[] { "WEEDS.S03E01-06.DUAL.Bluray.AC3.-HELLYWOOD.avi", QualityTypes.Bluray720p, false }, @@ -58,7 +54,7 @@ public class QualityParserTests : CoreTest new object[] { "White.Van.Man.2011.S02E01.WS.PDTV.x264-TLA", QualityTypes.SDTV, false }, new object[] { "White.Van.Man.2011.S02E01.WS.PDTV.x264-REPACK-TLA", QualityTypes.SDTV, true }, new object[] { "WEEDS.S03E01-06.DUAL.XviD.Bluray.AC3-REPACK.-HELLYWOOD.avi", QualityTypes.DVD, true }, - new object[] { "Pawn Stars S04E87 REPACK 720p HDTV x264 aAF", QualityTypes.HDTV, true }, + new object[] { "Pawn Stars S04E87 REPACK 720p HDTV x264 aAF", QualityTypes.HDTV720p, true }, new object[] { "The Real Housewives of Vancouver S01E04 DSR x264 2HD", QualityTypes.SDTV, false }, new object[] { "Vanguard S01E04 Mexicos Death Train DSR x264 MiNDTHEGAP", QualityTypes.SDTV, false }, new object[] { "Vanguard S01E04 Mexicos Death Train 720p WEB DL", QualityTypes.WEBDL720p, false }, @@ -74,7 +70,13 @@ public class QualityParserTests : CoreTest new object[] { "Elementary.S01E10.The.Leviathan.480p.WEB-DL.x264-mSD", QualityTypes.WEBDL480p, false }, new object[] { "Glee.S04E10.Glee.Actually.480p.WEB-DL.x264-mSD", QualityTypes.WEBDL480p, false }, new object[] { "The.Big.Bang.Theory.S06E11.The.Santa.Simulation.480p.WEB-DL.x264-mSD", QualityTypes.WEBDL480p, false }, - new object[] { "The.Big.Bang.Theory.S06E11.The.Santa.Simulation.1080p.WEB-DL.DD5.1.H.264", QualityTypes.WEBDL1080p, false } + new object[] { "The.Big.Bang.Theory.S06E11.The.Santa.Simulation.1080p.WEB-DL.DD5.1.H.264", QualityTypes.WEBDL1080p, false }, + new object[] { "DEXTER.S07E01.ARE.YOU.1080P.HDTV.X264-QCF", QualityTypes.HDTV1080p, false }, + new object[] { "DEXTER.S07E01.ARE.YOU.1080P.HDTV.x264-QCF", QualityTypes.HDTV1080p, false }, + new object[] { "DEXTER.S07E01.ARE.YOU.1080P.HDTV.proper.X264-QCF", QualityTypes.HDTV1080p, true }, + new object[] { "Dexter - S01E01 - Title [HDTV]", QualityTypes.HDTV720p, false }, + new object[] { "Dexter - S01E01 - Title [HDTV-720p]", QualityTypes.HDTV720p, false }, + new object[] { "Dexter - S01E01 - Title [HDTV-1080p]", QualityTypes.HDTV1080p, false } }; public static object[] SelfQualityParserCases = @@ -82,7 +84,7 @@ public class QualityParserTests : CoreTest new object[] { QualityTypes.SDTV }, new object[] { QualityTypes.DVD }, new object[] { QualityTypes.WEBDL480p }, - new object[] { QualityTypes.HDTV }, + new object[] { QualityTypes.HDTV720p }, new object[] { QualityTypes.WEBDL720p }, new object[] { QualityTypes.WEBDL1080p }, new object[] { QualityTypes.Bluray720p }, diff --git a/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs b/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs index 2a47bfa9d..e3c9b79a6 100644 --- a/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs @@ -23,7 +23,7 @@ public class QualityAllowedByProfileSpecificationFixture : CoreTest public static object[] AllowedTestCases = { new object[] { QualityTypes.DVD }, - new object[] { QualityTypes.HDTV }, + new object[] { QualityTypes.HDTV720p }, new object[] { QualityTypes.Bluray1080p } }; @@ -56,7 +56,7 @@ public void Setup() public void should_allow_if_quality_is_defined_in_profile(QualityTypes qualityType) { parseResult.Quality.Quality = qualityType; - parseResult.Series.QualityProfile.Allowed = new List { QualityTypes.DVD, QualityTypes.HDTV, QualityTypes.Bluray1080p }; + parseResult.Series.QualityProfile.Allowed = new List { QualityTypes.DVD, QualityTypes.HDTV720p, QualityTypes.Bluray1080p }; _qualityAllowedByProfile.IsSatisfiedBy(parseResult).Should().BeTrue(); } @@ -65,7 +65,7 @@ public void should_allow_if_quality_is_defined_in_profile(QualityTypes qualityTy public void should_not_allow_if_quality_is_not_defined_in_profile(QualityTypes qualityType) { parseResult.Quality.Quality = qualityType; - parseResult.Series.QualityProfile.Allowed = new List { QualityTypes.DVD, QualityTypes.HDTV, QualityTypes.Bluray1080p }; + parseResult.Series.QualityProfile.Allowed = new List { QualityTypes.DVD, QualityTypes.HDTV720p, QualityTypes.Bluray1080p }; _qualityAllowedByProfile.IsSatisfiedBy(parseResult).Should().BeFalse(); } diff --git a/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs b/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs index f6a7abb8b..a8ad64e89 100644 --- a/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs @@ -20,8 +20,8 @@ public class QualityUpgradeSpecificationFixture : CoreTest new object[] { QualityTypes.WEBDL720p, false, QualityTypes.WEBDL720p, true, QualityTypes.WEBDL720p, true }, new object[] { QualityTypes.SDTV, false, QualityTypes.SDTV, false, QualityTypes.SDTV, false }, new object[] { QualityTypes.SDTV, false, QualityTypes.DVD, true, QualityTypes.SDTV, false }, - new object[] { QualityTypes.WEBDL720p, false, QualityTypes.HDTV, true, QualityTypes.Bluray720p, false }, - new object[] { QualityTypes.WEBDL720p, false, QualityTypes.HDTV, true, QualityTypes.WEBDL720p, false }, + new object[] { QualityTypes.WEBDL720p, false, QualityTypes.HDTV720p, true, QualityTypes.Bluray720p, false }, + new object[] { QualityTypes.WEBDL720p, false, QualityTypes.HDTV720p, true, QualityTypes.WEBDL720p, false }, new object[] { QualityTypes.WEBDL720p, false, QualityTypes.WEBDL720p, false, QualityTypes.WEBDL720p, false }, new object[] { QualityTypes.SDTV, false, QualityTypes.SDTV, true, QualityTypes.SDTV, true }, new object[] { QualityTypes.WEBDL1080p, false, QualityTypes.WEBDL1080p, false, QualityTypes.WEBDL1080p, false } diff --git a/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/ImportFileFixture.cs b/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/ImportFileFixture.cs index 1e81eaac0..fb0f789e7 100644 --- a/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/ImportFileFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/ImportFileFixture.cs @@ -24,7 +24,7 @@ public class ImportFileFixture : CoreTest { new object[] { QualityTypes.SDTV, false }, new object[] { QualityTypes.DVD, true }, - new object[] { QualityTypes.HDTV, false } + new object[] { QualityTypes.HDTV720p, false } }; private readonly long SIZE = 80.Megabytes(); diff --git a/NzbDrone.Core.Test/ProviderTests/DownloadClientTests/SabProviderTests/QueueFixture.cs b/NzbDrone.Core.Test/ProviderTests/DownloadClientTests/SabProviderTests/QueueFixture.cs index 5bbb0f80d..56ca84c3b 100644 --- a/NzbDrone.Core.Test/ProviderTests/DownloadClientTests/SabProviderTests/QueueFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/DownloadClientTests/SabProviderTests/QueueFixture.cs @@ -183,7 +183,7 @@ public void is_in_queue_should_find_if_exact_full_season_release_is_in_queue() new object[] { 1, new[] { 6 }, "Some other show", QualityTypes.Bluray1080p, true }, //Different series, same season, episode new object[] { 1, new[] { 5 }, "Rock", QualityTypes.Bluray1080p, true }, //Similar series, same season, episodes new object[] { 1, new[] { 5 }, "30 Rock", QualityTypes.Bluray720p, false }, //Same series, higher quality - new object[] { 1, new[] { 5 }, "30 Rock", QualityTypes.HDTV, true } //Same series, higher quality + new object[] { 1, new[] { 5 }, "30 Rock", QualityTypes.HDTV720p, true } //Same series, higher quality }; [Test, TestCaseSource("DifferentEpisodeCases")] @@ -209,9 +209,9 @@ public void IsInQueue_should_not_find_diffrent_episode_queue(int season, int[] e { new object[] { 1, new[] { 5 }, "30 Rock", QualityTypes.SDTV, false }, //Same Series, lower quality new object[] { 1, new[] { 5 }, "30 rocK", QualityTypes.SDTV, false }, //Same Series, different casing - new object[] { 1, new[] { 5 }, "30 RocK", QualityTypes.HDTV, false }, //Same Series, same quality - new object[] { 1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV, false }, //Same Series, same quality, one different episode - new object[] { 1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV, false }, //Same Series, same quality, one different episode + new object[] { 1, new[] { 5 }, "30 RocK", QualityTypes.HDTV720p, false }, //Same Series, same quality + new object[] { 1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV720p, false }, //Same Series, same quality, one different episode + new object[] { 1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV720p, false }, //Same Series, same quality, one different episode new object[] { 4, new[] { 8 }, "Parks and Recreation", QualityTypes.WEBDL720p, false }, //Same Series, same quality }; @@ -237,9 +237,9 @@ public void IsInQueue_should_find_same_or_lower_quality_episode_queue(int season public static object[] DuplicateItemsCases = { new object[] { 5, new[] { 13 }, "The Big Bang Theory", QualityTypes.SDTV, false }, //Same Series, lower quality - new object[] { 5, new[] { 13 }, "The Big Bang Theory", QualityTypes.HDTV, false }, //Same Series, same quality - new object[] { 5, new[] { 13 }, "The Big Bang Theory", QualityTypes.HDTV, true }, //Same Series, same quality - new object[] { 5, new[] { 13, 14 }, "The Big Bang Theory", QualityTypes.HDTV, false } //Same Series, same quality, one diffrent episode + new object[] { 5, new[] { 13 }, "The Big Bang Theory", QualityTypes.HDTV720p, false }, //Same Series, same quality + new object[] { 5, new[] { 13 }, "The Big Bang Theory", QualityTypes.HDTV720p, true }, //Same Series, same quality + new object[] { 5, new[] { 13, 14 }, "The Big Bang Theory", QualityTypes.HDTV720p, false } //Same Series, same quality, one diffrent episode }; [Test, TestCaseSource("DuplicateItemsCases")] @@ -265,7 +265,7 @@ public void IsInQueue_should_find_items_marked_as_duplicate(int season, int[] ep { new object[] { 3, new[] { 14, 15 }, "My Name Is Earl", QualityTypes.Bluray720p, false }, new object[] { 3, new[] { 15 }, "My Name Is Earl", QualityTypes.DVD, false }, - new object[] { 3, new[] { 14 }, "My Name Is Earl", QualityTypes.HDTV, false }, + new object[] { 3, new[] { 14 }, "My Name Is Earl", QualityTypes.HDTV720p, false }, new object[] { 3, new[] { 15, 16 }, "My Name Is Earl", QualityTypes.SDTV, false } }; diff --git a/NzbDrone.Core.Test/ProviderTests/DownloadProviderFixture.cs b/NzbDrone.Core.Test/ProviderTests/DownloadProviderFixture.cs index 0a7fbffa9..cd5dbdda0 100644 --- a/NzbDrone.Core.Test/ProviderTests/DownloadProviderFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/DownloadProviderFixture.cs @@ -25,9 +25,9 @@ public class DownloadProviderFixture : CoreTest new object[] { 1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, "My Series Name - 1x02 - My Episode Title [DVD]" }, new object[] { 1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, "My Series Name - 1x02 - My Episode Title [DVD] [Proper]" }, new object[] { 1, new[] { 2 }, "", QualityTypes.DVD, true, "My Series Name - 1x02 - [DVD] [Proper]" }, - new object[] { 1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, false, "My Series Name - 1x02-1x04 - My Episode Title [HDTV]" }, - new object[] { 1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, true, "My Series Name - 1x02-1x04 - My Episode Title [HDTV] [Proper]" }, - new object[] { 1, new[] { 2, 4 }, "", QualityTypes.HDTV, true, "My Series Name - 1x02-1x04 - [HDTV] [Proper]" }, + new object[] { 1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV720p, false, "My Series Name - 1x02-1x04 - My Episode Title [HDTV-720p]" }, + new object[] { 1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV720p, true, "My Series Name - 1x02-1x04 - My Episode Title [HDTV-720p] [Proper]" }, + new object[] { 1, new[] { 2, 4 }, "", QualityTypes.HDTV720p, true, "My Series Name - 1x02-1x04 - [HDTV-720p] [Proper]" }, }; private void SetDownloadClient(DownloadClientType clientType) @@ -281,13 +281,13 @@ public void should_not_repeat_the_same_episode_title() { AirDate = DateTime.Now, EpisodeNumbers = new List{ 10, 11 }, - Quality = new QualityModel(QualityTypes.HDTV, false), + Quality = new QualityModel(QualityTypes.HDTV720p, false), SeasonNumber = 35, Series = series, Episodes = fakeEpisodes }; - Mocker.Resolve().GetDownloadTitle(parsResult).Should().Be("My Series Name - 5x01-5x02 - My Episode Title [HDTV]"); + Mocker.Resolve().GetDownloadTitle(parsResult).Should().Be("My Series Name - 5x01-5x02 - My Episode Title [HDTV-720p]"); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/ProviderTests/HistoryProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/HistoryProviderTest.cs index 3375fa39c..5a70735d1 100644 --- a/NzbDrone.Core.Test/ProviderTests/HistoryProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/HistoryProviderTest.cs @@ -212,7 +212,7 @@ public void add_item() var episode = Builder.CreateNew().Build(); - QualityTypes quality = QualityTypes.HDTV; + QualityTypes quality = QualityTypes.HDTV720p; const bool proper = true; var history = new History diff --git a/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTest.cs index 041bd7a76..58b34fd3a 100644 --- a/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTest.cs @@ -111,7 +111,7 @@ public void Scan_series_should_skip_series_with_no_episodes() } [Test] - [TestCase("Law & Order: Criminal Intent - S10E07 - Icarus [HDTV]", "Law & Order- Criminal Intent - S10E07 - Icarus [HDTV]")] + [TestCase("Law & Order: Criminal Intent - S10E07 - Icarus [HDTV-720p]", "Law & Order- Criminal Intent - S10E07 - Icarus [HDTV-720p]")] public void CleanFileName(string name, string expectedName) { //Act diff --git a/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTests/GetNewFilenameFixture.cs b/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTests/GetNewFilenameFixture.cs index a01d64299..c765d0561 100644 --- a/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTests/GetNewFilenameFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/MediaFileProviderTests/GetNewFilenameFixture.cs @@ -52,10 +52,10 @@ public void GetNewFilename_Series_Episode_Quality_S01E05_Dash() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("South Park - S15E06 - City Sushi [HDTV]", result); + Assert.AreEqual("South Park - S15E06 - City Sushi [HDTV-720p]", result); } [Test] @@ -79,10 +79,10 @@ public void GetNewFilename_Episode_Quality_1x05_Dash() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("15x06 - City Sushi [HDTV]", result); + Assert.AreEqual("15x06 - City Sushi [HDTV-720p]", result); } [Test] @@ -106,10 +106,10 @@ public void GetNewFilename_Series_Quality_01x05_Space() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("South Park 05x06 [HDTV]", result); + Assert.AreEqual("South Park 05x06 [HDTV-720p]", result); } [Test] @@ -134,7 +134,7 @@ public void GetNewFilename_Series_s01e05_Space() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert Assert.AreEqual("South Park s05e06", result); @@ -161,7 +161,7 @@ public void GetNewFilename_Series_Episode_s01e05_Periods() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert Assert.AreEqual("South.Park.s05e06.City.Sushi", result); @@ -188,10 +188,10 @@ public void GetNewFilename_Series_Episode_s01e05_Dash_Periods_Quality() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("South.Park.-.s05e06.-.City.Sushi.[HDTV]", result); + Assert.AreEqual("South.Park.-.s05e06.-.City.Sushi.[HDTV-720p]", result); } [Test] @@ -216,7 +216,7 @@ public void GetNewFilename_S01E05_Dash() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert Assert.AreEqual("S15E06", result); @@ -250,10 +250,10 @@ public void GetNewFilename_multi_Series_Episode_Quality_S01E05_Scene_Dash() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("The Mentalist - S03E23-E24 - Strawberries and Cream [HDTV]", result); + Assert.AreEqual("The Mentalist - S03E23-E24 - Strawberries and Cream [HDTV-720p]", result); } [Test] @@ -284,10 +284,10 @@ public void GetNewFilename_multi_Episode_Quality_1x05_Repeat_Dash() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("3x23x24 - Strawberries and Cream [HDTV]", result); + Assert.AreEqual("3x23x24 - Strawberries and Cream [HDTV-720p]", result); } [Test] @@ -318,10 +318,10 @@ public void GetNewFilename_multi_Episode_Quality_01x05_Repeat_Space() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("3x23x24 Strawberries and Cream [HDTV]", result); + Assert.AreEqual("3x23x24 Strawberries and Cream [HDTV-720p]", result); } [Test] @@ -352,7 +352,7 @@ public void GetNewFilename_multi_Series_Episode_s01e05_Duplicate_Period() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert Assert.AreEqual("The.Mentalist.s03e23.s03e24.Strawberries.and.Cream", result); @@ -386,7 +386,7 @@ public void GetNewFilename_multi_Series_S01E05_Extend_Dash_Period() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert Assert.AreEqual("The.Mentalist.-.S03E23-24", result); @@ -420,7 +420,7 @@ public void GetNewFilename_multi_1x05_Repeat_Dash_Period() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert Assert.AreEqual("3x23x24", result); @@ -445,10 +445,10 @@ public void GetNewFilename_should_append_proper_when_proper_and_append_quality_i .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, true, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, true, new EpisodeFile()); //Assert - result.Should().Be("South Park - S15E06 - City Sushi [HDTV] [Proper]"); + result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p] [Proper]"); } [Test] @@ -470,10 +470,10 @@ public void GetNewFilename_should_not_append_proper_when_not_proper_and_append_q .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - result.Should().Be("South Park - S15E06 - City Sushi [HDTV]"); + result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p]"); } [Test] @@ -495,7 +495,7 @@ public void GetNewFilename_should_not_append_proper_when_proper_and_append_quali .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, true, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, true, new EpisodeFile()); //Assert result.Should().Be("South Park - S15E06 - City Sushi"); @@ -527,7 +527,7 @@ public void GetNewFilename_should_order_multiple_episode_files_in_numerical_orde .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!"); @@ -554,10 +554,10 @@ public void GetNewFilename_Series_Episode_Quality_S01E05_Period() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("South Park.S15E06.City Sushi [HDTV]", result); + Assert.AreEqual("South Park.S15E06.City Sushi [HDTV-720p]", result); } [Test] @@ -581,10 +581,10 @@ public void GetNewFilename_Episode_Quality_1x05_Period() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert - Assert.AreEqual("15x06.City Sushi [HDTV]", result); + Assert.AreEqual("15x06.City Sushi [HDTV-720p]", result); } [Test] @@ -612,7 +612,7 @@ public void GetNewFilename_UseSceneName_when_sceneName_isNull() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, episodeFile); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, episodeFile); //Assert result.Should().Be(Path.GetFileNameWithoutExtension(episodeFile.Path)); @@ -643,7 +643,7 @@ public void GetNewFilename_UseSceneName_when_sceneName_isNotNull() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV, false, episodeFile); + string result = Mocker.Resolve().GetNewFilename(new List { episode }, _series, QualityTypes.HDTV720p, false, episodeFile); //Assert result.Should().Be(episodeFile.SceneName); @@ -675,7 +675,7 @@ public void should_only_have_one_episodeTitle_when_episode_titles_are_the_same() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!"); @@ -707,7 +707,7 @@ public void should_have_two_episodeTitles_when_episode_titles_are_not_the_same() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert result.Should().Be("30 Rock - S06E06-E07 - Hello + World"); @@ -745,7 +745,7 @@ public void should_have_two_episodeTitles_when_distinct_count_is_two() .Build(); //Act - string result = Mocker.Resolve().GetNewFilename(new List { episode, episode2, episode3 }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile()); + string result = Mocker.Resolve().GetNewFilename(new List { episode, episode2, episode3 }, new Series { Title = "30 Rock" }, QualityTypes.HDTV720p, false, new EpisodeFile()); //Assert result.Should().Be("30 Rock - S06E06-E07-E08 - Hello + World"); @@ -776,8 +776,8 @@ public void should_use_airDate_if_series_isDaily() .Build(); var result = Mocker.Resolve() - .GetNewFilename(episodes, series, QualityTypes.HDTV, false, new EpisodeFile()); - result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13 - Kristen Stewart [HDTV]"); + .GetNewFilename(episodes, series, QualityTypes.HDTV720p, false, new EpisodeFile()); + result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13 - Kristen Stewart [HDTV-720p]"); } [Test] @@ -805,7 +805,7 @@ public void should_use_airDate_if_series_isDaily_no_episode_title() .Build(); var result = Mocker.Resolve() - .GetNewFilename(episodes, series, QualityTypes.HDTV, false, new EpisodeFile()); + .GetNewFilename(episodes, series, QualityTypes.HDTV720p, false, new EpisodeFile()); result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13"); } @@ -834,7 +834,7 @@ public void should_set_airdate_to_unknown_if_not_available() .Build(); var result = Mocker.Resolve() - .GetNewFilename(episodes, series, QualityTypes.HDTV, false, new EpisodeFile()); + .GetNewFilename(episodes, series, QualityTypes.HDTV720p, false, new EpisodeFile()); result.Should().Be("The Daily Show with Jon Stewart - Unknown - Kristen Stewart"); } } diff --git a/NzbDrone.Core.Test/ProviderTests/QualityTypeProviderTest.cs b/NzbDrone.Core.Test/ProviderTests/QualityTypeProviderTest.cs index 5135342fe..039061499 100644 --- a/NzbDrone.Core.Test/ProviderTests/QualityTypeProviderTest.cs +++ b/NzbDrone.Core.Test/ProviderTests/QualityTypeProviderTest.cs @@ -29,11 +29,12 @@ public void SetupDefault_should_add_all_profiles() //Assert var types = Mocker.Resolve().All(); - types.Should().HaveCount(8); + types.Should().HaveCount(9); types.Should().Contain(e => e.Name == "SDTV" && e.QualityTypeId == 1); types.Should().Contain(e => e.Name == "DVD" && e.QualityTypeId == 2); types.Should().Contain(e => e.Name == "WEBDL-480p" && e.QualityTypeId == 8); - types.Should().Contain(e => e.Name == "HDTV" && e.QualityTypeId == 4); + types.Should().Contain(e => e.Name == "HDTV-720p" && e.QualityTypeId == 4); + types.Should().Contain(e => e.Name == "HDTV-1080p" && e.QualityTypeId == 9); types.Should().Contain(e => e.Name == "WEBDL-720p" && e.QualityTypeId == 5); types.Should().Contain(e => e.Name == "WEBDL-1080p" && e.QualityTypeId == 3); types.Should().Contain(e => e.Name == "Bluray720p" && e.QualityTypeId == 6); @@ -55,7 +56,7 @@ public void SetupDefault_already_exists_should_insert_missing() //Assert var types = Mocker.Resolve().All(); - types.Should().HaveCount(8); + types.Should().HaveCount(QualityTypes.All().Count - 1); } [Test] diff --git a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs index c4968880f..72783d57c 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessDailySearchResultsFixture.cs @@ -147,7 +147,7 @@ public void processSearchResults_should_skip_if_series_is_null() var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = DateTime.Today) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithNullSeries(); @@ -168,7 +168,7 @@ public void processSearchResults_should_skip_if_series_is_mismatched() var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = DateTime.Today) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithMisMatchedSeries(); @@ -244,7 +244,7 @@ public void processSearchResults_should_skip_if_parseResult_does_not_have_airdat var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = null) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithMatchingSeries(); @@ -265,7 +265,7 @@ public void processSearchResults_should_skip_if_parseResult_airdate_does_not_mat var parseResults = Builder.CreateListOfSize(5) .All() .With(e => e.AirDate = DateTime.Today.AddDays(10)) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithMatchingSeries(); diff --git a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs index b14873e11..52c74cb77 100644 --- a/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/SearchProviderTests/ProcessSearchResultsFixture.cs @@ -183,7 +183,7 @@ public void processSearchResults_should_skip_if_series_is_null() .All() .With(e => e.SeasonNumber = 1) .With(e => e.EpisodeNumbers = new List { 1 }) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithNullSeries(); @@ -206,7 +206,7 @@ public void processSearchResults_should_skip_if_series_is_mismatched() .All() .With(e => e.SeasonNumber = 1) .With(e => e.EpisodeNumbers = new List { 1 }) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithMisMatchedSeries(); @@ -229,7 +229,7 @@ public void processSearchResults_should_skip_if_season_doesnt_match() .All() .With(e => e.SeasonNumber = 2) .With(e => e.EpisodeNumbers = new List { 1 }) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithMatchingSeries(); @@ -252,7 +252,7 @@ public void processSearchResults_should_skip_if_episodeNumber_doesnt_match() .All() .With(e => e.SeasonNumber = 1) .With(e => e.EpisodeNumbers = new List { 2 }) - .With(e => e.Quality = new QualityModel(QualityTypes.HDTV, false)) + .With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false)) .Build(); WithMatchingSeries(); diff --git a/NzbDrone.Core.Test/QualityProfileTest.cs b/NzbDrone.Core.Test/QualityProfileTest.cs index 1214382e4..d0bc8c912 100644 --- a/NzbDrone.Core.Test/QualityProfileTest.cs +++ b/NzbDrone.Core.Test/QualityProfileTest.cs @@ -26,7 +26,7 @@ public void Test_Storage() { Name = Guid.NewGuid().ToString(), Cutoff = QualityTypes.SDTV, - Allowed = new List { QualityTypes.HDTV, QualityTypes.DVD }, + Allowed = new List { QualityTypes.HDTV720p, QualityTypes.DVD }, }; //Act @@ -106,7 +106,7 @@ public void Test_Series_Quality() { Name = Guid.NewGuid().ToString(), Cutoff = QualityTypes.SDTV, - Allowed = new List { QualityTypes.HDTV, QualityTypes.DVD }, + Allowed = new List { QualityTypes.HDTV720p, QualityTypes.DVD }, }; diff --git a/NzbDrone.Core.Test/QualityTypesTest.cs b/NzbDrone.Core.Test/QualityTypesTest.cs index 19b282b5b..ce598cc02 100644 --- a/NzbDrone.Core.Test/QualityTypesTest.cs +++ b/NzbDrone.Core.Test/QualityTypesTest.cs @@ -17,7 +17,7 @@ public class QualityTypesTest : CoreTest { new object[] {1, QualityTypes.SDTV}, new object[] {2, QualityTypes.DVD}, - new object[] {4, QualityTypes.HDTV}, + new object[] {4, QualityTypes.HDTV720p}, new object[] {5, QualityTypes.WEBDL720p}, new object[] {6, QualityTypes.Bluray720p}, new object[] {7, QualityTypes.Bluray1080p} @@ -27,7 +27,7 @@ public class QualityTypesTest : CoreTest { new object[] {QualityTypes.SDTV, 1}, new object[] {QualityTypes.DVD, 2}, - new object[] {QualityTypes.HDTV, 4}, + new object[] {QualityTypes.HDTV720p, 4}, new object[] {QualityTypes.WEBDL720p, 5}, new object[] {QualityTypes.Bluray720p, 6}, new object[] {QualityTypes.Bluray1080p, 7} diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index f1b6b23ef..cfadf83e2 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -314,9 +314,16 @@ internal static QualityModel ParseQuality(string name) result.Quality = QualityTypes.WEBDL480p; return result; } + if (normalizedName.Contains("x264") || normalizedName.Contains("h264") || normalizedName.Contains("720p")) { - result.Quality = QualityTypes.HDTV; + if(normalizedName.Contains("1080p")) + { + result.Quality = QualityTypes.HDTV1080p; + return result; + } + + result.Quality = QualityTypes.HDTV720p; return result; } //Based on extension @@ -348,7 +355,7 @@ internal static QualityModel ParseQuality(string name) case ".mkv": case ".ts": { - result.Quality = QualityTypes.HDTV; + result.Quality = QualityTypes.HDTV720p; break; } } @@ -362,7 +369,13 @@ internal static QualityModel ParseQuality(string name) if (name.Contains("[HDTV]")) { - result.Quality = QualityTypes.HDTV; + result.Quality = QualityTypes.HDTV720p; + return result; + } + + if (normalizedName.Contains("hdtv") && normalizedName.Contains("1080p")) + { + result.Quality = QualityTypes.HDTV1080p; return result; } diff --git a/NzbDrone.Core/Providers/QualityProvider.cs b/NzbDrone.Core/Providers/QualityProvider.cs index 5222b22ae..1842c1f07 100644 --- a/NzbDrone.Core/Providers/QualityProvider.cs +++ b/NzbDrone.Core/Providers/QualityProvider.cs @@ -68,8 +68,8 @@ public virtual void SetupDefaultProfiles() var hd = new QualityProfile { Name = "HD", - Allowed = new List { QualityTypes.HDTV, QualityTypes.WEBDL720p, QualityTypes.Bluray720p }, - Cutoff = QualityTypes.HDTV + Allowed = new List { QualityTypes.HDTV720p, QualityTypes.WEBDL720p, QualityTypes.Bluray720p }, + Cutoff = QualityTypes.HDTV720p }; Add(sd); diff --git a/NzbDrone.Core/Repository/Quality/QualityTypes.cs b/NzbDrone.Core/Repository/Quality/QualityTypes.cs index e055de8a4..dbcf14280 100644 --- a/NzbDrone.Core/Repository/Quality/QualityTypes.cs +++ b/NzbDrone.Core/Repository/Quality/QualityTypes.cs @@ -96,11 +96,12 @@ public override bool Equals(object obj) public static QualityTypes SDTV = new QualityTypes {Id = 1, Name = "SDTV", Weight = 1}; public static QualityTypes WEBDL480p = new QualityTypes { Id = 8, Name = "WEBDL-480p", Weight = 2 }; public static QualityTypes DVD = new QualityTypes { Id = 2, Name = "DVD", Weight = 3 }; - public static QualityTypes HDTV = new QualityTypes { Id = 4, Name = "HDTV", Weight = 4 }; - public static QualityTypes WEBDL720p = new QualityTypes { Id = 5, Name = "WEBDL-720p", Weight = 5 }; - public static QualityTypes Bluray720p = new QualityTypes { Id = 6, Name = "Bluray720p", Weight = 6 }; - public static QualityTypes WEBDL1080p = new QualityTypes { Id = 3, Name = "WEBDL-1080p", Weight = 7 }; - public static QualityTypes Bluray1080p = new QualityTypes { Id = 7, Name = "Bluray1080p", Weight = 8 }; + public static QualityTypes HDTV720p = new QualityTypes { Id = 4, Name = "HDTV-720p", Weight = 4 }; + public static QualityTypes HDTV1080p = new QualityTypes { Id = 9, Name = "HDTV-1080p", Weight = 5 }; + public static QualityTypes WEBDL720p = new QualityTypes { Id = 5, Name = "WEBDL-720p", Weight = 6 }; + public static QualityTypes Bluray720p = new QualityTypes { Id = 6, Name = "Bluray720p", Weight = 7 }; + public static QualityTypes WEBDL1080p = new QualityTypes { Id = 3, Name = "WEBDL-1080p", Weight = 8 }; + public static QualityTypes Bluray1080p = new QualityTypes { Id = 7, Name = "Bluray1080p", Weight = 9 }; public static List All() { @@ -110,7 +111,8 @@ public static List All() SDTV, WEBDL480p, DVD, - HDTV, + HDTV720p, + HDTV1080p, WEBDL720p, WEBDL1080p, Bluray720p, diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index af79c336a..15b36aa40 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -283,7 +283,7 @@ public PartialViewResult GetQualityProfileView(int profileId) model.Allowed = profile.Allowed; model.Sdtv = profile.Allowed.Contains(QualityTypes.SDTV); model.Dvd = profile.Allowed.Contains(QualityTypes.DVD); - model.Hdtv = profile.Allowed.Contains(QualityTypes.HDTV); + model.Hdtv = profile.Allowed.Contains(QualityTypes.HDTV720p); model.Webdl720p = profile.Allowed.Contains(QualityTypes.WEBDL720p); model.Webdl1080p = profile.Allowed.Contains(QualityTypes.WEBDL1080p); model.Bluray720p = profile.Allowed.Contains(QualityTypes.Bluray720p); @@ -292,7 +292,7 @@ public PartialViewResult GetQualityProfileView(int profileId) model.SdtvId = QualityTypes.SDTV.Id; model.DvdId = QualityTypes.DVD.Id; - model.HdtvId = QualityTypes.HDTV.Id; + model.HdtvId = QualityTypes.HDTV720p.Id; model.Webdl720pId = QualityTypes.WEBDL720p.Id; model.Webdl1080pId = QualityTypes.WEBDL1080p.Id; model.Bluray720pId = QualityTypes.Bluray720p.Id; @@ -494,7 +494,7 @@ public JsonResult SaveQuality(QualityModel data) profile.Allowed.Add(QualityTypes.DVD); if (profileModel.Hdtv) - profile.Allowed.Add(QualityTypes.HDTV); + profile.Allowed.Add(QualityTypes.HDTV720p); if (profileModel.Webdl720p) profile.Allowed.Add(QualityTypes.WEBDL720p);