1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00
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
This commit is contained in:
Mark McDowall 2013-01-09 00:15:06 -08:00
parent b8fff306bf
commit 106ea1d04b
8 changed files with 48 additions and 18 deletions

View File

@ -26,8 +26,8 @@ public override object OnGet(QualityTypeModel request)
{
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);

View File

@ -399,6 +399,7 @@ public void parse_releaseGroup(string title, string expected)
[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);

View File

@ -47,7 +47,7 @@ public class QualityParserFixture : CoreTest
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 @@ public class QualityParserFixture : CoreTest
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 =

View File

@ -387,5 +387,16 @@ public void IsAcceptableSize_should_treat_daily_series_as_single_episode()
//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();
}
}
}

View File

@ -78,7 +78,10 @@ public static class Parser
{
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 @@ internal static QualityModel ParseQuality(string name)
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"))

View File

@ -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 @@ public AcceptableSizeSpecification()
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.");

View File

@ -98,10 +98,12 @@ public override bool Equals(object obj)
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 @@ public static List<QualityTypes> All()
DVD,
HDTV720p,
HDTV1080p,
RAWHD,
WEBDL720p,
WEBDL1080p,
Bluray720p,

View File

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