Added parsing for 1080p HDTV

New: Support for 1080p HDTV (parsing only)
This commit is contained in:
Mark McDowall 2012-12-31 19:45:57 -08:00
parent 72c7fc2680
commit f032917595
24 changed files with 158 additions and 141 deletions

View File

@ -21,10 +21,10 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 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 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 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 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 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 @@ namespace NzbDrone.Core.Test
parseResult.EpisodeNumbers = new List<int> { 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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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 @@ namespace NzbDrone.Core.Test
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]");
}
}

View File

@ -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":"",

View File

@ -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",

View File

@ -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",

View File

@ -158,7 +158,7 @@
<Compile Include="JobTests\RssSyncJobTest.cs" />
<Compile Include="JobTests\PostDownloadScanJobFixture.cs" />
<Compile Include="JobTests\RecentBacklogSearchJobTest.cs" />
<Compile Include="ParserFixture\QualityParserTests.cs" />
<Compile Include="ParserTests\QualityParserFixture.cs" />
<Compile Include="ProviderTests\ConfigProviderTests\ConfigCachingFixture.cs" />
<Compile Include="ProviderTests\BannerProviderTest.cs" />
<Compile Include="ProviderTests\DecisionEngineTests\AllowedReleaseGroupSpecificationFixture.cs" />
@ -245,7 +245,7 @@
<Compile Include="ProviderTests\ConfigProviderTests\ConfigProviderFixture.cs" />
<Compile Include="ProviderTests\EpisodeProviderTests\EpisodeProviderTest.cs" />
<Compile Include="Framework\TestDbHelper.cs" />
<Compile Include="ParserFixture\ParserTest.cs" />
<Compile Include="ParserTests\ParserFixture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="QualityProfileTest.cs" />
<Compile Include="ProviderTests\DownloadClientTests\SabProviderTests\SabProviderFixture.cs" />

View File

@ -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 @@ namespace NzbDrone.Core.Test.ParserFixture
[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 @@ namespace NzbDrone.Core.Test.ParserFixture
[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 })]

View File

@ -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 @@ namespace NzbDrone.Core.Test.ParserFixture
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 @@ namespace NzbDrone.Core.Test.ParserFixture
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[] { "(<a href=\"http://www.newzbin.com/browse/post/6076286/nzb/\">NZB</a>)", 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 @@ namespace NzbDrone.Core.Test.ParserFixture
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 @@ namespace NzbDrone.Core.Test.ParserFixture
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 @@ namespace NzbDrone.Core.Test.ParserFixture
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 },

View File

@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
public static object[] AllowedTestCases =
{
new object[] { QualityTypes.DVD },
new object[] { QualityTypes.HDTV },
new object[] { QualityTypes.HDTV720p },
new object[] { QualityTypes.Bluray1080p }
};
@ -56,7 +56,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
public void should_allow_if_quality_is_defined_in_profile(QualityTypes qualityType)
{
parseResult.Quality.Quality = qualityType;
parseResult.Series.QualityProfile.Allowed = new List<QualityTypes> { QualityTypes.DVD, QualityTypes.HDTV, QualityTypes.Bluray1080p };
parseResult.Series.QualityProfile.Allowed = new List<QualityTypes> { QualityTypes.DVD, QualityTypes.HDTV720p, QualityTypes.Bluray1080p };
_qualityAllowedByProfile.IsSatisfiedBy(parseResult).Should().BeTrue();
}
@ -65,7 +65,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
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> { QualityTypes.DVD, QualityTypes.HDTV, QualityTypes.Bluray1080p };
parseResult.Series.QualityProfile.Allowed = new List<QualityTypes> { QualityTypes.DVD, QualityTypes.HDTV720p, QualityTypes.Bluray1080p };
_qualityAllowedByProfile.IsSatisfiedBy(parseResult).Should().BeFalse();
}

View File

@ -20,8 +20,8 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
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 }

View File

@ -24,7 +24,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DiskScanProviderTests
{
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();

View File

@ -183,7 +183,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
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 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
{
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 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
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 @@ namespace NzbDrone.Core.Test.ProviderTests.DownloadClientTests.SabProviderTests
{
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 }
};

View File

@ -25,9 +25,9 @@ namespace NzbDrone.Core.Test.ProviderTests
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 @@ namespace NzbDrone.Core.Test.ProviderTests
{
AirDate = DateTime.Now,
EpisodeNumbers = new List<int>{ 10, 11 },
Quality = new QualityModel(QualityTypes.HDTV, false),
Quality = new QualityModel(QualityTypes.HDTV720p, false),
SeasonNumber = 35,
Series = series,
Episodes = fakeEpisodes
};
Mocker.Resolve<DownloadProvider>().GetDownloadTitle(parsResult).Should().Be("My Series Name - 5x01-5x02 - My Episode Title [HDTV]");
Mocker.Resolve<DownloadProvider>().GetDownloadTitle(parsResult).Should().Be("My Series Name - 5x01-5x02 - My Episode Title [HDTV-720p]");
}
}
}

View File

@ -212,7 +212,7 @@ namespace NzbDrone.Core.Test.ProviderTests
var episode = Builder<Episode>.CreateNew().Build();
QualityTypes quality = QualityTypes.HDTV;
QualityTypes quality = QualityTypes.HDTV720p;
const bool proper = true;
var history = new History

View File

@ -111,7 +111,7 @@ namespace NzbDrone.Core.Test.ProviderTests
}
[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

View File

@ -52,10 +52,10 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile());
//Assert
Assert.AreEqual("South Park s05e06", result);
@ -161,7 +161,7 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile());
//Assert
Assert.AreEqual("South.Park.s05e06.City.Sushi", result);
@ -188,10 +188,10 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV720p, false, new EpisodeFile());
//Assert
Assert.AreEqual("S15E06", result);
@ -250,10 +250,10 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile());
//Assert
Assert.AreEqual("The.Mentalist.-.S03E23-24", result);
@ -420,7 +420,7 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, QualityTypes.HDTV720p, false, new EpisodeFile());
//Assert
Assert.AreEqual("3x23x24", result);
@ -445,10 +445,10 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, true, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, true, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV720p, true, new EpisodeFile());
//Assert
result.Should().Be("South Park - S15E06 - City Sushi");
@ -527,7 +527,7 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, episodeFile);
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV720p, false, episodeFile);
//Assert
result.Should().Be(Path.GetFileNameWithoutExtension(episodeFile.Path));
@ -643,7 +643,7 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV, false, episodeFile);
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode }, _series, QualityTypes.HDTV720p, false, episodeFile);
//Assert
result.Should().Be(episodeFile.SceneName);
@ -675,7 +675,7 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
//Act
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { episode, episode2, episode3 }, new Series { Title = "30 Rock" }, QualityTypes.HDTV, false, new EpisodeFile());
string result = Mocker.Resolve<MediaFileProvider>().GetNewFilename(new List<Episode> { 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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
var result = Mocker.Resolve<MediaFileProvider>()
.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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
var result = Mocker.Resolve<MediaFileProvider>()
.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 @@ namespace NzbDrone.Core.Test.ProviderTests.MediaFileProviderTests
.Build();
var result = Mocker.Resolve<MediaFileProvider>()
.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");
}
}

View File

@ -29,11 +29,12 @@ namespace NzbDrone.Core.Test.ProviderTests
//Assert
var types = Mocker.Resolve<QualityTypeProvider>().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 @@ namespace NzbDrone.Core.Test.ProviderTests
//Assert
var types = Mocker.Resolve<QualityTypeProvider>().All();
types.Should().HaveCount(8);
types.Should().HaveCount(QualityTypes.All().Count - 1);
}
[Test]

View File

@ -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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, 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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false))
.Build();
WithMisMatchedSeries();
@ -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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, 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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false))
.Build();
WithMatchingSeries();

View File

@ -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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, 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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, 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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, 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 QualityModel(QualityTypes.HDTV, false))
.With(e => e.Quality = new QualityModel(QualityTypes.HDTV720p, false))
.Build();
WithMatchingSeries();

View File

@ -26,7 +26,7 @@ namespace NzbDrone.Core.Test
{
Name = Guid.NewGuid().ToString(),
Cutoff = QualityTypes.SDTV,
Allowed = new List<QualityTypes> { QualityTypes.HDTV, QualityTypes.DVD },
Allowed = new List<QualityTypes> { QualityTypes.HDTV720p, QualityTypes.DVD },
};
//Act
@ -106,7 +106,7 @@ namespace NzbDrone.Core.Test
{
Name = Guid.NewGuid().ToString(),
Cutoff = QualityTypes.SDTV,
Allowed = new List<QualityTypes> { QualityTypes.HDTV, QualityTypes.DVD },
Allowed = new List<QualityTypes> { QualityTypes.HDTV720p, QualityTypes.DVD },
};

View File

@ -17,7 +17,7 @@ namespace NzbDrone.Core.Test
{
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 @@ namespace NzbDrone.Core.Test
{
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}

View File

@ -314,9 +314,16 @@ namespace NzbDrone.Core
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 @@ namespace NzbDrone.Core
case ".mkv":
case ".ts":
{
result.Quality = QualityTypes.HDTV;
result.Quality = QualityTypes.HDTV720p;
break;
}
}
@ -362,7 +369,13 @@ namespace NzbDrone.Core
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;
}

View File

@ -68,8 +68,8 @@ namespace NzbDrone.Core.Providers
var hd = new QualityProfile
{
Name = "HD",
Allowed = new List<QualityTypes> { QualityTypes.HDTV, QualityTypes.WEBDL720p, QualityTypes.Bluray720p },
Cutoff = QualityTypes.HDTV
Allowed = new List<QualityTypes> { QualityTypes.HDTV720p, QualityTypes.WEBDL720p, QualityTypes.Bluray720p },
Cutoff = QualityTypes.HDTV720p
};
Add(sd);

View File

@ -96,11 +96,12 @@ namespace NzbDrone.Core.Repository.Quality
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<QualityTypes> All()
{
@ -110,7 +111,8 @@ namespace NzbDrone.Core.Repository.Quality
SDTV,
WEBDL480p,
DVD,
HDTV,
HDTV720p,
HDTV1080p,
WEBDL720p,
WEBDL1080p,
Bluray720p,

View File

@ -283,7 +283,7 @@ namespace NzbDrone.Web.Controllers
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 @@ namespace NzbDrone.Web.Controllers
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 @@ namespace NzbDrone.Web.Controllers
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);