New: Added support for UltraHD (2160p) quality

pull/2/head
Björn Dahlgren 9 years ago committed by Taloth Saldono
parent bdb1076100
commit 94323f79e7

@ -18,10 +18,13 @@ namespace NzbDrone.Core.Test.ParserTests
new object[] { Quality.WEBDL480p },
new object[] { Quality.HDTV720p },
new object[] { Quality.HDTV1080p },
new object[] { Quality.HDTV2160p },
new object[] { Quality.WEBDL720p },
new object[] { Quality.WEBDL1080p },
new object[] { Quality.WEBDL2160p },
new object[] { Quality.Bluray720p },
new object[] { Quality.Bluray1080p }
new object[] { Quality.Bluray1080p },
new object[] { Quality.Bluray2160p },
};
public static object[] OtherSourceQualityParserCases =
@ -31,10 +34,13 @@ namespace NzbDrone.Core.Test.ParserTests
new object[] { "480p WEB-DL", Quality.WEBDL480p },
new object[] { "HD TV", Quality.HDTV720p },
new object[] { "1080p HD TV", Quality.HDTV1080p },
new object[] { "2160p HD TV", Quality.HDTV2160p },
new object[] { "720p WEB-DL", Quality.WEBDL720p },
new object[] { "1080p WEB-DL", Quality.WEBDL1080p },
new object[] { "2160p WEB-DL", Quality.WEBDL2160p },
new object[] { "720p BluRay", Quality.Bluray720p },
new object[] { "1080p BluRay", Quality.Bluray1080p }
new object[] { "1080p BluRay", Quality.Bluray1080p },
new object[] { "2160p BluRay", Quality.Bluray2160p },
};
[TestCase("S07E23 .avi ", false)]
@ -157,6 +163,15 @@ namespace NzbDrone.Core.Test.ParserTests
ParseAndVerifyQuality(title, Quality.WEBDL1080p, proper);
}
[TestCase("CASANOVA S01E01.2160P AMZN WEBRIP DD2.0 HI10P X264-TROLLUHD", false)]
[TestCase("JUST ADD MAGIC S01E01.2160P AMZN WEBRIP DD2.0 X264-TROLLUHD", false)]
[TestCase("The.Man.In.The.High.Castle.S01E01.2160p.AMZN.WEBRip.DD2.0.Hi10p.X264-TrollUHD", false)]
[TestCase("The Man In the High Castle S01E01 2160p AMZN WEBRip DD2.0 Hi10P x264-TrollUHD", false)]
public void should_parse_webdl2160p_quality(string title, bool proper)
{
ParseAndVerifyQuality(title, Quality.WEBDL2160p, proper);
}
[TestCase("WEEDS.S03E01-06.DUAL.Bluray.AC3.-HELLYWOOD.avi", false)]
[TestCase("Chuck - S01E03 - Come Fly With Me - 720p BluRay.mkv", false)]
[TestCase("The Big Bang Theory.S03E01.The Electric Can Opener Fluctuation.m2ts", false)]

@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.Profiles
Subject.Handle(new ApplicationStartedEvent());
Mocker.GetMock<IProfileRepository>()
.Verify(v => v.Insert(It.IsAny<Profile>()), Times.Exactly(5));
.Verify(v => v.Insert(It.IsAny<Profile>()), Times.Exactly(6));
}
[Test]

@ -13,22 +13,38 @@ namespace NzbDrone.Core.Test.Qualities
{
public static object[] FromIntCases =
{
new object[] {0, Quality.Unknown},
new object[] {1, Quality.SDTV},
new object[] {2, Quality.DVD},
new object[] {3, Quality.WEBDL1080p},
new object[] {4, Quality.HDTV720p},
new object[] {5, Quality.WEBDL720p},
new object[] {6, Quality.Bluray720p},
new object[] {7, Quality.Bluray1080p}
new object[] {7, Quality.Bluray1080p},
new object[] {8, Quality.WEBDL480p},
new object[] {9, Quality.HDTV1080p},
new object[] {10, Quality.RAWHD},
new object[] {12, Quality.HDTV2160p},
new object[] {13, Quality.WEBDL2160p},
new object[] {14, Quality.Bluray2160p},
};
public static object[] ToIntCases =
{
new object[] {Quality.Unknown, 0},
new object[] {Quality.SDTV, 1},
new object[] {Quality.DVD, 2},
new object[] {Quality.WEBDL1080p, 3},
new object[] {Quality.HDTV720p, 4},
new object[] {Quality.WEBDL720p, 5},
new object[] {Quality.Bluray720p, 6},
new object[] {Quality.Bluray1080p, 7}
new object[] {Quality.Bluray1080p, 7},
new object[] {Quality.WEBDL480p, 8},
new object[] {Quality.HDTV1080p, 9},
new object[] {Quality.RAWHD, 10},
new object[] {Quality.HDTV2160p, 12},
new object[] {Quality.WEBDL2160p, 13},
new object[] {Quality.Bluray2160p, 14},
};
[Test, TestCaseSource("FromIntCases")]
@ -49,16 +65,20 @@ namespace NzbDrone.Core.Test.Qualities
{
var qualities = new List<Quality>
{
Quality.Unknown,
Quality.SDTV,
Quality.WEBDL480p,
Quality.DVD,
Quality.HDTV720p,
Quality.HDTV1080p,
Quality.HDTV2160p,
Quality.RAWHD,
Quality.WEBDL720p,
Quality.Bluray720p,
Quality.WEBDL1080p,
Quality.Bluray1080p
Quality.WEBDL2160p,
Quality.Bluray720p,
Quality.Bluray1080p,
Quality.Bluray2160p,
};
if (allowed.Length == 0)

@ -222,7 +222,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex CleanTorrentSuffixRegex = new Regex(@"\[(?:ettv|rartv|rarbg|cttv)\]$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+)\b(?<!WEB-DL|480p|720p|1080p)",
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+)\b(?<!WEB-DL|480p|720p|1080p|2160p)",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex AnimeReleaseGroupRegex = new Regex(@"^(?:\[(?<subgroup>(?!\s).+?(?<!\s))\](?:_|-|\s|\.)?)",

@ -38,7 +38,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex RealRegex = new Regex(@"\b(?<real>REAL)\b",
RegexOptions.Compiled);
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<_480p>480p|640x480|848x480)|(?<_576p>576p)|(?<_720p>720p|1280x720)|(?<_1080p>1080p|1920x1080))\b",
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<_480p>480p|640x480|848x480)|(?<_576p>576p)|(?<_720p>720p|1280x720)|(?<_1080p>1080p|1920x1080)|(?<_2160p>2160p))\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex CodecRegex = new Regex(@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>divx))\b",
@ -76,6 +76,12 @@ namespace NzbDrone.Core.Parser
return result;
}
if (resolution == Resolution._2160p)
{
result.Quality = Quality.Bluray2160p;
return result;
}
if (resolution == Resolution._1080p)
{
result.Quality = Quality.Bluray1080p;
@ -94,6 +100,12 @@ namespace NzbDrone.Core.Parser
if (sourceMatch.Groups["webdl"].Success)
{
if (resolution == Resolution._2160p)
{
result.Quality = Quality.WEBDL2160p;
return result;
}
if (resolution == Resolution._1080p)
{
result.Quality = Quality.WEBDL1080p;
@ -118,6 +130,12 @@ namespace NzbDrone.Core.Parser
if (sourceMatch.Groups["hdtv"].Success)
{
if (resolution == Resolution._2160p)
{
result.Quality = Quality.HDTV2160p;
return result;
}
if (resolution == Resolution._1080p)
{
result.Quality = Quality.HDTV1080p;
@ -198,6 +216,12 @@ namespace NzbDrone.Core.Parser
return result;
}
if (resolution == Resolution._2160p)
{
result.Quality = Quality.HDTV2160p;
return result;
}
if (resolution == Resolution._1080p)
{
result.Quality = Quality.HDTV1080p;
@ -296,6 +320,7 @@ namespace NzbDrone.Core.Parser
if (match.Groups["_576p"].Success) return Resolution._576p;
if (match.Groups["_720p"].Success) return Resolution._720p;
if (match.Groups["_1080p"].Success) return Resolution._1080p;
if (match.Groups["_2160p"].Success) return Resolution._2160p;
return Resolution.Unknown;
}
@ -346,6 +371,7 @@ namespace NzbDrone.Core.Parser
_576p,
_720p,
_1080p,
_2160p,
Unknown
}
}

@ -94,7 +94,8 @@ namespace NzbDrone.Core.Profiles
Quality.WEBDL720p,
Quality.WEBDL1080p,
Quality.Bluray720p,
Quality.Bluray1080p);
Quality.Bluray1080p,
Quality.WEBDL2160p);
AddDefaultProfile("SD", Quality.SDTV,
Quality.SDTV,
@ -111,13 +112,21 @@ namespace NzbDrone.Core.Profiles
Quality.WEBDL1080p,
Quality.Bluray1080p);
AddDefaultProfile("HD-2160p", Quality.HDTV2160p,
Quality.HDTV2160p,
Quality.WEBDL2160p,
Quality.Bluray2160p);
AddDefaultProfile("HD - All", Quality.HDTV720p,
Quality.HDTV720p,
Quality.HDTV1080p,
Quality.HDTV2160p,
Quality.WEBDL720p,
Quality.WEBDL1080p,
Quality.WEBDL2160p,
Quality.Bluray720p,
Quality.Bluray1080p);
Quality.Bluray1080p,
Quality.Bluray2160p);
}
}
}

@ -67,6 +67,9 @@ namespace NzbDrone.Core.Qualities
public static Quality HDTV1080p { get { return new Quality(9, "HDTV-1080p"); } }
public static Quality RAWHD { get { return new Quality(10, "Raw-HD"); } }
//public static Quality HDTV480p { get { return new Quality(11, "HDTV-480p"); } }
public static Quality HDTV2160p { get { return new Quality(12, "HDTV-2160p"); } }
public static Quality WEBDL2160p { get { return new Quality(13, "WEBDL-2160p"); } }
public static Quality Bluray2160p { get { return new Quality(14, "Bluray-2160p"); } }
public static List<Quality> All
{
@ -84,7 +87,10 @@ namespace NzbDrone.Core.Qualities
Bluray1080p,
WEBDL480p,
HDTV1080p,
RAWHD
RAWHD,
HDTV2160p,
WEBDL2160p,
Bluray2160p,
};
}
}
@ -105,7 +111,10 @@ namespace NzbDrone.Core.Qualities
new QualityDefinition(Quality.WEBDL720p) { Weight = 8, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray720p) { Weight = 9, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL1080p) { Weight = 10, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray1080p) { Weight = 11, MinSize = 0, MaxSize = 100 }
new QualityDefinition(Quality.Bluray1080p) { Weight = 11, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV2160p) { Weight = 12, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL2160p) { Weight = 13, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray2160p) { Weight = 14, MinSize = 0, MaxSize = 100 },
};
}
}

Loading…
Cancel
Save