New: Raw-HD (TrollHD) support added
Fixed: Parser for TrollHD releases from NzbIndex and NzbClub
#ND-115 fixed
#ND-115 comment Max size will be ignored for Raw-HD releases, since they
are always very large anyways
pull/21/head
Mark McDowall 12 years ago
parent b8fff306bf
commit 106ea1d04b

@ -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<Core.Repository.Quality.QualityType>, List<QualityTypeModel>>(profiles);
var types = _qualityTypeProvider.All().Where(qualityType => qualityType.QualityTypeId != 0 && qualityType.QualityTypeId != 10).ToList();
return Mapper.Map<List<Core.Repository.Quality.QualityType>, List<QualityTypeModel>>(types);
}
var type = _qualityTypeProvider.Get(request.Id);

@ -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);

@ -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 =

@ -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<AcceptableSizeSpecification>().IsSatisfiedBy(parseResult).Should().BeTrue();
}
}
}

@ -79,6 +79,9 @@ namespace NzbDrone.Core
new Regex(@"(?:\[.+\]\-\[.+\]\-\[.+\]\-\[)(?<nzbTitle>.+)(?:\]\-.+)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
new Regex(@"(?:\[.+\]\W+\[.+\]\W+\[.+\]\W+\"")(?<nzbTitle>.+)(?:\"".+)",
RegexOptions.IgnoreCase | RegexOptions.Compiled),
new Regex(@"(?:\[)(?<nzbTitle>.+)(?:\]\-.+)",
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"))

@ -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);
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?
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);
//0 will be treated as unlimited
if (qualityType.MaxSize == 0)
{
logger.Trace("Max size is 0 (unlimited) - skipping check.");

@ -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<QualityTypes> All()
{
@ -113,6 +115,7 @@ namespace NzbDrone.Core.Repository.Quality
DVD,
HDTV720p,
HDTV1080p,
RAWHD,
WEBDL720p,
WEBDL1080p,
Bluray720p,

@ -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)

Loading…
Cancel
Save