1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: MPEG-2 remuxes being detected as "Raw-HD" quality

Fixes #2986
This commit is contained in:
Leonardo Galli 2018-10-15 09:53:33 +02:00
parent 0c542eeb13
commit 4f4e6c494d
2 changed files with 13 additions and 8 deletions

View File

@ -236,6 +236,8 @@ public void should_parse_bluray576p_quality(string title)
[TestCase("Contract.to.Kill.2016.REMUX.1080p.BluRay.AVC.DTS-HD.MA.5.1-iFT")]
[TestCase("27.Dresses.2008.REMUX.1080p.Bluray.AVC.DTS-HR.MA.5.1-LEGi0N")]
[TestCase("27.Dresses.2008.BDREMUX.1080p.Bluray.AVC.DTS-HR.MA.5.1-LEGi0N")]
[TestCase("The.Stoning.of.Soraya.M.2008.USA.BluRay.Remux.1080p.MPEG-2.DD.5.1-TDD")]
[TestCase("Wildling.2018.1080p.BluRay.REMUX.MPEG-2.DTS-HD.MA.5.1-EPSiLON")]
public void should_parse_remux1080p_quality(string title)
{
ParseAndVerifyQuality(title, Source.BLURAY, false, Resolution.R1080P, Modifier.REMUX);
@ -344,7 +346,10 @@ public void should_parse_hardcoded_subs(string postTitle, string sub)
private void ParseAndVerifyQuality(string title, Source source, bool proper, Resolution resolution, Modifier modifier = Modifier.NONE)
{
var result = QualityParser.ParseQuality(title);
result.Resolution.Should().Be(resolution);
if (resolution != Resolution.Unknown)
{
result.Resolution.Should().Be(resolution);
}
result.Source.Should().Be(source);
if (modifier != Modifier.NONE)
{

View File

@ -104,13 +104,6 @@ public static QualityModel ParseQuality(string name)
}
}
if (RawHDRegex.IsMatch(normalizedName))
{
result.Modifier = Modifier.RAWHD;
result.Source = Source.TV;
return result;
}
var sourceMatch = SourceRegex.Matches(normalizedName).OfType<Match>().LastOrDefault();
var resolution = ParseResolution(normalizedName);
var codecRegex = CodecRegex.Match(normalizedName);
@ -130,6 +123,13 @@ public static QualityModel ParseQuality(string name)
return result; //We found remux!
}
if (RawHDRegex.IsMatch(normalizedName) && result.Modifier != Modifier.BRDISK)
{
result.Modifier = Modifier.RAWHD;
result.Source = Source.TV;
return result;
}
if (sourceMatch != null && sourceMatch.Success)
{
if (sourceMatch.Groups["bluray"].Success)