mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 08:19:38 +02:00
New: Parse 960p as 720p instead of 480p, parse 540p
Fixes #6304 Fixes #6767
This commit is contained in:
parent
9d6614b14a
commit
507e8ec814
@ -87,6 +87,8 @@ public void should_parse_dvdr_quality(string title, bool proper)
|
|||||||
[TestCase("Movie.Name.S06E11.The.Santa.Simulation.480p.WEB-DL.x264-mSD", false)]
|
[TestCase("Movie.Name.S06E11.The.Santa.Simulation.480p.WEB-DL.x264-mSD", false)]
|
||||||
[TestCase("Movie.Name.S02E04.480p.WEB.DL.nSD.x264-NhaNc3", false)]
|
[TestCase("Movie.Name.S02E04.480p.WEB.DL.nSD.x264-NhaNc3", false)]
|
||||||
[TestCase("[HorribleSubs] Movie Title! 2018 [Web][MKV][h264][480p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
|
[TestCase("[HorribleSubs] Movie Title! 2018 [Web][MKV][h264][480p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
|
||||||
|
[TestCase("[SubsPlease] Movie Title (540p) [AB649D32].mkv", false)]
|
||||||
|
[TestCase("[Erai-raws] Movie Title [540p][Multiple Subtitle].mkv", false)]
|
||||||
public void should_parse_webdl480p_quality(string title, bool proper)
|
public void should_parse_webdl480p_quality(string title, bool proper)
|
||||||
{
|
{
|
||||||
ParseAndVerifyQuality(title, Source.WEBDL, proper, Resolution.R480p);
|
ParseAndVerifyQuality(title, Source.WEBDL, proper, Resolution.R480p);
|
||||||
@ -148,6 +150,7 @@ public void should_parse_hdtv1080p_quality(string title, bool proper)
|
|||||||
[TestCase("Movie Name.S01E01.The.Insanity.Principle.720p.WEB-DL.DD5.1.H.264-BD", false)]
|
[TestCase("Movie Name.S01E01.The.Insanity.Principle.720p.WEB-DL.DD5.1.H.264-BD", false)]
|
||||||
[TestCase("[HorribleSubs] Movie Title! 2018 [Web][MKV][h264][720p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
|
[TestCase("[HorribleSubs] Movie Title! 2018 [Web][MKV][h264][720p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
|
||||||
[TestCase("[HorribleSubs] Movie Title! 2018 [Web][MKV][h264][AAC 2.0][Softsubs (HorribleSubs)]", false)]
|
[TestCase("[HorribleSubs] Movie Title! 2018 [Web][MKV][h264][AAC 2.0][Softsubs (HorribleSubs)]", false)]
|
||||||
|
[TestCase("Movie.Title.2013.960p.WEB-DL.AAC2.0.H.264-squalor", false)]
|
||||||
public void should_parse_webdl720p_quality(string title, bool proper)
|
public void should_parse_webdl720p_quality(string title, bool proper)
|
||||||
{
|
{
|
||||||
ParseAndVerifyQuality(title, Source.WEBDL, proper, Resolution.R720p);
|
ParseAndVerifyQuality(title, Source.WEBDL, proper, Resolution.R720p);
|
||||||
|
@ -56,7 +56,7 @@ public class QualityParser
|
|||||||
private static readonly Regex RealRegex = new Regex(@"\b(?<real>REAL)\b",
|
private static readonly Regex RealRegex = new Regex(@"\b(?<real>REAL)\b",
|
||||||
RegexOptions.Compiled);
|
RegexOptions.Compiled);
|
||||||
|
|
||||||
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<R360p>360p)|(?<R480p>480p|640x480|848x480)|(?<R576p>576p)|(?<R720p>720p|1280x720)|(?<R1080p>1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?<R2160p>2160p|3840x2160|4k[-_. ](?:UHD|HEVC|BD|H265)|(?:UHD|HEVC|BD|H265)[-_. ]4k))\b",
|
private static readonly Regex ResolutionRegex = new Regex(@"\b(?:(?<R360p>360p)|(?<R480p>480p|640x480|848x480)|(?<R540p>540p)|(?<R576p>576p)|(?<R720p>720p|1280x720|960p)|(?<R1080p>1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?<R2160p>2160p|3840x2160|4k[-_. ](?:UHD|HEVC|BD|H265)|(?:UHD|HEVC|BD|H265)[-_. ]4k))\b",
|
||||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
//Handle cases where no resolution is in the release name; assume if UHD then 4k
|
//Handle cases where no resolution is in the release name; assume if UHD then 4k
|
||||||
@ -184,7 +184,8 @@ public static QualityModel ParseQualityName(string name)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resolution == Resolution.R360p || resolution == Resolution.R480p)
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
||||||
|
resolution == Resolution.R540p)
|
||||||
{
|
{
|
||||||
result.Quality = Quality.Bluray480p;
|
result.Quality = Quality.Bluray480p;
|
||||||
return result;
|
return result;
|
||||||
@ -397,7 +398,9 @@ public static QualityModel ParseQualityName(string name)
|
|||||||
{
|
{
|
||||||
result.SourceDetectionSource = QualityDetectionSource.Name;
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
||||||
|
|
||||||
if (resolution == Resolution.R360p || resolution == Resolution.R480p || resolution == Resolution.R576p || normalizedName.ContainsIgnoreCase("480p"))
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
||||||
|
resolution == Resolution.R540p || resolution == Resolution.R576p ||
|
||||||
|
normalizedName.ContainsIgnoreCase("480p"))
|
||||||
{
|
{
|
||||||
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
||||||
result.Quality = Quality.DVD;
|
result.Quality = Quality.DVD;
|
||||||
@ -434,7 +437,8 @@ public static QualityModel ParseQualityName(string name)
|
|||||||
result.SourceDetectionSource = QualityDetectionSource.Name;
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
||||||
|
|
||||||
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
||||||
resolution == Resolution.R576p || normalizedName.ContainsIgnoreCase("480p"))
|
resolution == Resolution.R540p || resolution == Resolution.R576p ||
|
||||||
|
normalizedName.ContainsIgnoreCase("480p"))
|
||||||
{
|
{
|
||||||
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
||||||
result.Quality = Quality.WEBDL480p;
|
result.Quality = Quality.WEBDL480p;
|
||||||
@ -524,7 +528,8 @@ public static QualityModel ParseQualityName(string name)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resolution == Resolution.R360p || resolution == Resolution.R480p)
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
||||||
|
resolution == Resolution.R540p || resolution == Resolution.R576p)
|
||||||
{
|
{
|
||||||
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
||||||
|
|
||||||
@ -657,6 +662,11 @@ private static Resolution ParseResolution(string name)
|
|||||||
return Resolution.R480p;
|
return Resolution.R480p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (match.Groups["R540p"].Success)
|
||||||
|
{
|
||||||
|
return Resolution.R540p;
|
||||||
|
}
|
||||||
|
|
||||||
if (match.Groups["R576p"].Success)
|
if (match.Groups["R576p"].Success)
|
||||||
{
|
{
|
||||||
return Resolution.R576p;
|
return Resolution.R576p;
|
||||||
@ -746,6 +756,7 @@ public enum Resolution
|
|||||||
Unknown,
|
Unknown,
|
||||||
R360p = 360,
|
R360p = 360,
|
||||||
R480p = 480,
|
R480p = 480,
|
||||||
|
R540p = 540,
|
||||||
R576p = 576,
|
R576p = 576,
|
||||||
R720p = 720,
|
R720p = 720,
|
||||||
R1080p = 1080,
|
R1080p = 1080,
|
||||||
|
Loading…
Reference in New Issue
Block a user