Update the regex in Parser, Add workprint and telesync, change R5 to regional allow for R[0-9]{1}, changed the weights

Devin Buhl 8 years ago
parent d5caac5d3b
commit a1f2369306

@ -14,14 +14,34 @@ namespace NzbDrone.Core.Parser
{
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(QualityParser));
//private static readonly Regex SourceRegex = new Regex(@"\b(?:
// (?<bluray>BluRay|Blu-Ray|HDDVD|BD)|
// (?<webdl>WEB[-_. ]DL|WEBDL|WebRip|iTunesHD|WebHD|[. ]WEB[. ](?:[xh]26[45]|DD5[. ]1)|\d+0p[. ]WEB[. ])|
// (?<hdtv>HDTV)|
// (?<bdrip>BDRip)|
// (?<brrip>BRRip)|
// (?<dvd>DVD|DVDRip|NTSC|PAL|xvidvd)|
// (?<dsr>WS[-_. ]DSR|DSR)|
// (?<pdtv>PDTV)|
// (?<sdtv>SDTV)|
// (?<tvrip>TVRip)
// )\b",
// RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
private static readonly Regex SourceRegex = new Regex(@"\b(?:
(?<bluray>BluRay|Blu-Ray|HDDVD|BD)|
(?<webdl>WEB[-_. ]DL|WEBDL|WebRip|iTunesHD|WebHD|[. ]WEB[. ](?:[xh]26[45]|DD5[. ]1)|\d+0p[. ]WEB[. ])|
(?<webdl>WEB[-_. ]DL|HDRIP|WEBDL|WebRip|Web-Rip|iTunesHD|WebHD|[. ]WEB[. ](?:[xh]26[45]|DD5[. ]1)|\d+0p[. ]WEB[. ])|
(?<hdtv>HDTV)|
(?<bdrip>BDRip)|
(?<brrip>BRRip)|
(?<bdrip>BDRip)|(?<brrip>BRRip)|
(?<dvdr>DVD-R|DVDR)|
(?<dvd>DVD|DVDRip|NTSC|PAL|xvidvd)|
(?<dsr>WS[-_. ]DSR|DSR)|
(?<regional>R[0-9]{1})|
(?<scr>SCR|SCREENER|DVDSCR|DVDSCREENER)|
(?<ts>TS|TELESYNC|HD-TS|HDTS|PDVD)|
(?<tc>TC|TELECINE|HD-TC|HDTC)|
(?<cam>CAMRIP|CAM|HDCAM|HD-CAM)|
(?<wp>WORKPRINT|WP)|
(?<pdtv>PDTV)|
(?<sdtv>SDTV)|
(?<tvrip>TVRip)
@ -108,7 +128,13 @@ namespace NzbDrone.Core.Parser
return result;
}
if (resolution == Resolution.R480P || resolution == Resolution.R576p)
if (resolution == Resolution.R576p)
{
result.Quality = Quality.Bluray576p;
return result;
}
if (resolution == Resolution.R480P)
{
result.Quality = Quality.DVD;
return result;
@ -195,12 +221,54 @@ namespace NzbDrone.Core.Parser
}
}
if (sourceMatch.Groups["wp"].Success)
{
result.Quality = Quality.WORKPRINT;
return result;
}
if (sourceMatch.Groups["dvd"].Success)
{
result.Quality = Quality.DVD;
return result;
}
if (sourceMatch.Groups["dvdr"].Success)
{
result.Quality = Quality.DVDR;
return result;
}
if (sourceMatch.Groups["scr"].Success)
{
result.Quality = Quality.DVDSCR;
return result;
}
if (sourceMatch.Groups["regional"].Success)
{
result.Quality = Quality.REGIONAL;
return result;
}
if (sourceMatch.Groups["cam"].Success)
{
result.Quality = Quality.CAM;
return result;
}
if (sourceMatch.Groups["ts"].Success)
{
result.Quality = Quality.TELESYNC;
return result;
}
if (sourceMatch.Groups["tc"].Success)
{
result.Quality = Quality.TELECINE;
return result;
}
if (sourceMatch.Groups["pdtv"].Success ||
sourceMatch.Groups["sdtv"].Success ||
sourceMatch.Groups["dsr"].Success ||

@ -85,11 +85,13 @@ namespace NzbDrone.Core.Profiles
_logger.Info("Setting up default quality profiles");
AddDefaultProfile("Any", Quality.DVD,
AddDefaultProfile("Any", Quality.Bluray480p,
Quality.WORKPRINT,
Quality.CAM,
Quality.TELESYNC,
Quality.TELECINE,
Quality.DVDSCR,
Quality.R5,
Quality.REGIONAL,
Quality.SDTV,
Quality.DVD,
Quality.DVDR,
@ -107,14 +109,18 @@ namespace NzbDrone.Core.Profiles
Quality.Bluray2160p,
Quality.BRDISK);
AddDefaultProfile("SD", Quality.DVD,
AddDefaultProfile("SD", Quality.Bluray480p,
Quality.WORKPRINT,
Quality.CAM,
Quality.TELESYNC,
Quality.TELECINE,
Quality.DVDSCR,
Quality.R5,
Quality.REGIONAL,
Quality.SDTV,
Quality.DVD,
Quality.WEBDL480p);
Quality.WEBDL480p,
Quality.Bluray480p,
Quality.Bluray576p);
AddDefaultProfile("HD-720p", Quality.Bluray720p,
Quality.HDTV720p,

@ -59,10 +59,12 @@ namespace NzbDrone.Core.Qualities
public static Quality Unknown => new Quality(0, "Unknown");
// Pre-release
public static Quality CAM => new Quality(24, "CAM"); // new
public static Quality TELECINE => new Quality(25, "TELECINE"); // new
public static Quality DVDSCR => new Quality(26, "DVDSCR"); // new
public static Quality R5 => new Quality(27, "R5"); // new
public static Quality WORKPRINT => new Quality(24, "WORKPRINT"); // new
public static Quality CAM => new Quality(25, "CAM"); // new
public static Quality TELESYNC => new Quality(26, "TELESYNC"); // new
public static Quality TELECINE => new Quality(27, "TELECINE"); // new
public static Quality DVDSCR => new Quality(28, "DVDSCR"); // new
public static Quality REGIONAL => new Quality(29, "REGIONAL"); // new
// SD
public static Quality SDTV => new Quality(1, "SDTV");
@ -96,10 +98,12 @@ namespace NzbDrone.Core.Qualities
All = new List<Quality>
{
Unknown,
WORKPRINT,
CAM,
TELESYNC,
TELECINE,
DVDSCR,
R5,
REGIONAL,
SDTV,
DVD,
DVDR,
@ -127,31 +131,33 @@ namespace NzbDrone.Core.Qualities
DefaultQualityDefinitions = new HashSet<QualityDefinition>
{
new QualityDefinition(Quality.Unknown) { Weight = 1, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.CAM) { Weight = 2, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.TELECINE) { Weight = 3, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.R5) { Weight = 4, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.DVDSCR) { Weight = 5, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.SDTV) { Weight = 6, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.DVD) { Weight = 7, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.DVDR) { Weight = 8, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL480p) { Weight = 9, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray480p) { Weight = 10, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray576p) { Weight = 11, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV720p) { Weight = 12, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL720p) { Weight = 13, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray720p) { Weight = 14, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV1080p) { Weight = 15, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL1080p) { Weight = 16, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray1080p) { Weight = 17, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.HDTV2160p) { Weight = 18, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.WEBDL2160p) { Weight = 19, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray2160p) { Weight = 20, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.BRDISK) { Weight = 21, MinSize = 0, MaxSize = null }
new QualityDefinition(Quality.WORKPRINT) { Weight = 2, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.CAM) { Weight = 3, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.TELESYNC) { Weight = 4, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.TELECINE) { Weight = 5, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.REGIONAL) { Weight = 6, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.DVDSCR) { Weight = 7, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.SDTV) { Weight = 8, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.DVD) { Weight = 9, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.DVDR) { Weight = 10, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL480p) { Weight = 11, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray480p) { Weight = 12, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray576p) { Weight = 13, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV720p) { Weight = 14, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL720p) { Weight = 15, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray720p) { Weight = 16, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV1080p) { Weight = 17, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL1080p) { Weight = 18, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray1080p) { Weight = 19, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.HDTV2160p) { Weight = 20, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.WEBDL2160p) { Weight = 21, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray2160p) { Weight = 22, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.BRDISK) { Weight = 23, MinSize = 0, MaxSize = null }
};
}

Loading…
Cancel
Save