|
|
|
@ -5,7 +5,7 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
{
|
|
|
|
|
public static class TvCategoryFromQualityParser
|
|
|
|
|
{
|
|
|
|
|
private static readonly Regex SourceRegex = new Regex(@"\b(?:
|
|
|
|
|
private static readonly Regex SourceRegex = new (@"\b(?:
|
|
|
|
|
(?<bluray>BluRay|Blu-Ray|HDDVD|BD)|
|
|
|
|
|
(?<webdl>WEB[-_. ]DL|WEBDL|WebRip|iTunesHD|WebHD)|
|
|
|
|
|
(?<hdtv>HDTV)|
|
|
|
|
@ -19,16 +19,16 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
)\b",
|
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex RawHdRegex = new Regex(@"\b(?<rawhd>TrollHD|RawHD|1080i[-_. ]HDTV|Raw[-_. ]HD|MPEG[-_. ]?2)\b",
|
|
|
|
|
private static readonly Regex RawHdRegex = new (@"\b(?<rawhd>TrollHD|RawHD|1080i[-_. ]HDTV|Raw[-_. ]HD|MPEG[-_. ]?2)\b",
|
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<q480p>480p|640x480|848x480)|(?<q576p>576p)|(?<q720p>720p|1280x720)|(?<q1080p>1080p|1920x1080))\b",
|
|
|
|
|
private static readonly Regex ResolutionRegex = new (@"\b(?:(?<q480p>480p|640x480|848x480)|(?<q576p>576p)|(?<q720p>720p|1280x720)|(?<q1080p>1080p|1920x1080)|(?<q2160p>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",
|
|
|
|
|
private static readonly Regex CodecRegex = new (@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>Xvid)|(?<divx>divx))\b",
|
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
|
|
private static readonly Regex HighDefPdtvRegex = new Regex(@"hr[-_. ]ws", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
private static readonly Regex HighDefPdtvRegex = new (@"hr[-_. ]ws", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
|
|
public static IndexerCategory ParseTvShowQuality(string tvShowFileName)
|
|
|
|
|
{
|
|
|
|
@ -40,6 +40,11 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
|
|
|
|
|
if (sourceMatch.Groups["webdl"].Success)
|
|
|
|
|
{
|
|
|
|
|
if (resolutionMatch.Groups["q2160p"].Success)
|
|
|
|
|
{
|
|
|
|
|
return NewznabStandardCategory.TVUHD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resolutionMatch.Groups["q1080p"].Success || resolutionMatch.Groups["q720p"].Success)
|
|
|
|
|
{
|
|
|
|
|
return NewznabStandardCategory.TVHD;
|
|
|
|
@ -53,6 +58,11 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
|
|
|
|
|
if (sourceMatch.Groups["hdtv"].Success)
|
|
|
|
|
{
|
|
|
|
|
if (resolutionMatch.Groups["q2160p"].Success)
|
|
|
|
|
{
|
|
|
|
|
return NewznabStandardCategory.TVUHD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resolutionMatch.Groups["q1080p"].Success || resolutionMatch.Groups["q720p"].Success)
|
|
|
|
|
{
|
|
|
|
|
return NewznabStandardCategory.TVHD;
|
|
|
|
@ -70,6 +80,11 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
return NewznabStandardCategory.TVSD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resolutionMatch.Groups["q2160p"].Success)
|
|
|
|
|
{
|
|
|
|
|
return NewznabStandardCategory.TVUHD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (resolutionMatch.Groups["q1080p"].Success || resolutionMatch.Groups["q720p"].Success)
|
|
|
|
|
{
|
|
|
|
|
return NewznabStandardCategory.TVHD;
|
|
|
|
|