diff --git a/NzbDrone.Api/QualityType/QualityTypeService.cs b/NzbDrone.Api/QualityType/QualityTypeService.cs index d1dff6bdd..664bbd8d0 100644 --- a/NzbDrone.Api/QualityType/QualityTypeService.cs +++ b/NzbDrone.Api/QualityType/QualityTypeService.cs @@ -26,8 +26,8 @@ namespace NzbDrone.Api.QualityType { if (request.Id == 0) { - var profiles = _qualityTypeProvider.All().Where(qualityProfile => qualityProfile.QualityTypeId > 0).ToList(); - return Mapper.Map, List>(profiles); + var types = _qualityTypeProvider.All().Where(qualityType => qualityType.QualityTypeId != 0 && qualityType.QualityTypeId != 10).ToList(); + return Mapper.Map, List>(types); } var type = _qualityTypeProvider.Get(request.Id); diff --git a/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 1cf159b22..80b405786 100644 --- a/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -399,6 +399,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("[112461]-[FULL]-[#a.b.teevee@EFNet]-[ 666.Park.Avenue.S01E03.720p.HDTV.X264-DIMENSION ]-[02/31] - \"the.devils.address.103.720p-dimension.par2\" yEnc", "666.Park.Avenue.S01E03.720p.HDTV.X264-DIMENSION")] [TestCase("[112438]-[FULL]-[#a.b.teevee@EFNet]-[ Downton_Abbey.3x05.HDTV_x264-FoV ]-[01/26] - \"downton_abbey.3x05.hdtv_x264-fov.nfo\" yEnc", "Downton_Abbey.3x05.HDTV_x264-FoV")] + [TestCase("[ 21154 ] - [ TrollHD ] - [ 00/73 ] - \"MythBusters S03E20 Escape Slide Parachute 1080i HDTV-UPSCALE DD5.1 MPEG2-TrollHD.nzb\" yEnc", "MythBusters S03E20 Escape Slide Parachute 1080i HDTV-UPSCALE DD5.1 MPEG2-TrollHD.nzb")] public void parse_header(string title, string expected) { Parser.ParseHeader(title).Should().Be(expected); diff --git a/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 4d7368d98..7cc5f7e41 100644 --- a/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.ParserTests 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 }, - new object[] { "The Voice S01E11 The Finals 1080i HDTV DD5.1 MPEG2-TrollHD", QualityTypes.Unknown, false }, + new object[] { "The Voice S01E11 The Finals 1080i HDTV DD5.1 MPEG2-TrollHD", QualityTypes.RAWHD, false }, new object[] { "Nikita S02E01 HDTV XviD 2HD", QualityTypes.SDTV, false }, new object[] { "Gossip Girl S05E11 PROPER HDTV XviD 2HD", QualityTypes.SDTV, true }, new object[] { "The Jonathan Ross Show S02E08 HDTV x264 FTP", QualityTypes.SDTV, false }, @@ -76,7 +76,9 @@ namespace NzbDrone.Core.Test.ParserTests 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 } + new object[] { "Dexter - S01E01 - Title [HDTV-1080p]", QualityTypes.HDTV1080p, false }, + new object[] { "POI S02E11 1080i HDTV DD5.1 MPEG2-TrollHD", QualityTypes.RAWHD, false }, + new object[] { "How I Met Your Mother S01E18 Nothing Good Happens After 2 A.M. 720p HDTV DD5.1 MPEG2-TrollHD", QualityTypes.RAWHD, false } }; public static object[] SelfQualityParserCases = diff --git a/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs b/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs index de8d9d381..2e1690a8c 100644 --- a/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs @@ -387,5 +387,16 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests //Assert result.Should().BeTrue(); } + + [Test] + public void should_return_true_if_RAWHD() + { + var parseResult = new EpisodeParseResult + { + Quality = new QualityModel(QualityTypes.RAWHD, false) + }; + + Mocker.Resolve().IsSatisfiedBy(parseResult).Should().BeTrue(); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 97096ee1d..12417c802 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -78,7 +78,10 @@ namespace NzbDrone.Core { new Regex(@"(?:\[.+\]\-\[.+\]\-\[.+\]\-\[)(?.+)(?:\]\-.+)", RegexOptions.IgnoreCase | RegexOptions.Compiled), - + + new Regex(@"(?:\[.+\]\W+\[.+\]\W+\[.+\]\W+\"")(?.+)(?:\"".+)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + new Regex(@"(?:\[)(?.+)(?:\]\-.+)", RegexOptions.IgnoreCase | RegexOptions.Compiled), }; @@ -315,6 +318,12 @@ namespace NzbDrone.Core return result; } + if (normalizedName.Contains("trollhd") || normalizedName.Contains("rawhd")) + { + result.Quality = QualityTypes.RAWHD; + return result; + } + if (normalizedName.Contains("x264") || normalizedName.Contains("h264") || normalizedName.Contains("720p")) { if(normalizedName.Contains("1080p")) diff --git a/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs b/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs index 4fe35d018..e4da2b573 100644 --- a/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs +++ b/NzbDrone.Core/Providers/DecisionEngine/AcceptableSizeSpecification.cs @@ -1,6 +1,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Model; +using NzbDrone.Core.Repository.Quality; namespace NzbDrone.Core.Providers.DecisionEngine { @@ -24,13 +25,15 @@ namespace NzbDrone.Core.Providers.DecisionEngine public virtual bool IsSatisfiedBy(EpisodeParseResult subject) { logger.Trace("Beginning size check for: {0}", subject); + + if(subject.Quality.Quality == QualityTypes.RAWHD) + { + logger.Trace("Raw-HD release found, skipping size check."); + return true; + } + var qualityType = _qualityTypeProvider.Get((int)subject.Quality.Quality); - //Need to determine if this is a 30 or 60 minute episode - //Is it a multi-episode release? - //Is it the first or last series of a season? - - //0 will be treated as unlimited if (qualityType.MaxSize == 0) { logger.Trace("Max size is 0 (unlimited) - skipping check."); diff --git a/NzbDrone.Core/Repository/Quality/QualityTypes.cs b/NzbDrone.Core/Repository/Quality/QualityTypes.cs index dbcf14280..1028743f9 100644 --- a/NzbDrone.Core/Repository/Quality/QualityTypes.cs +++ b/NzbDrone.Core/Repository/Quality/QualityTypes.cs @@ -98,10 +98,12 @@ namespace NzbDrone.Core.Repository.Quality public static QualityTypes DVD = new QualityTypes { Id = 2, Name = "DVD", Weight = 3 }; 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 QualityTypes RAWHD = new QualityTypes { Id = 10, Name = "Raw-HD", Weight = 6 }; + public static QualityTypes WEBDL720p = new QualityTypes { Id = 5, Name = "WEBDL-720p", Weight = 7 }; + public static QualityTypes Bluray720p = new QualityTypes { Id = 6, Name = "Bluray720p", Weight = 8 }; + public static QualityTypes WEBDL1080p = new QualityTypes { Id = 3, Name = "WEBDL-1080p", Weight = 9 }; + public static QualityTypes Bluray1080p = new QualityTypes { Id = 7, Name = "Bluray1080p", Weight = 10 }; + public static List All() { @@ -113,6 +115,7 @@ namespace NzbDrone.Core.Repository.Quality DVD, HDTV720p, HDTV1080p, + RAWHD, WEBDL720p, WEBDL1080p, Bluray720p, diff --git a/NzbDrone.Web/Scripts/backbone/views/qualityProfiles.js b/NzbDrone.Web/Scripts/backbone/views/qualityProfiles.js index 968fdaf49..2fdf1567c 100644 --- a/NzbDrone.Web/Scripts/backbone/views/qualityProfiles.js +++ b/NzbDrone.Web/Scripts/backbone/views/qualityProfiles.js @@ -112,10 +112,11 @@ QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({ { "Id": 2, "Weight": 3, "Name": "DVD", "Allowed": false }, { "Id": 4, "Weight": 4, "Name": "HDTV-720p", "Allowed": false }, { "Id": 9, "Weight": 5, "Name": "HDTV-1080p", "Allowed": false }, - { "Id": 5, "Weight": 6, "Name": "WEBDL-720p", "Allowed": false }, - { "Id": 3, "Weight": 6, "Name": "WEBDL-1080p", "Allowed": false }, - { "Id": 6, "Weight": 8, "Name": "Bluray720p", "Allowed": false }, - { "Id": 7, "Weight": 9, "Name": "Bluray1080p", "Allowed": false } + { "Id": 10, "Weight": 6, "Name": "Raw-HD", "Allowed": false }, + { "Id": 5, "Weight": 7, "Name": "WEBDL-720p", "Allowed": false }, + { "Id": 3, "Weight": 7, "Name": "WEBDL-1080p", "Allowed": false }, + { "Id": 6, "Weight": 9, "Name": "Bluray720p", "Allowed": false }, + { "Id": 7, "Weight": 10, "Name": "Bluray1080p", "Allowed": false } ] }); //Todo: It would be nice to not have to save this on add (via create)