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

Fixes #2986
pull/3108/head
Leonardo Galli 6 years ago
parent 0c542eeb13
commit 4f4e6c494d

@ -236,6 +236,8 @@ namespace NzbDrone.Core.Test.ParserTests
[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 @@ namespace NzbDrone.Core.Test.ParserTests
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)
{

@ -104,13 +104,6 @@ namespace NzbDrone.Core.Parser
}
}
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);
@ -129,6 +122,13 @@ namespace NzbDrone.Core.Parser
result.Source = Source.BLURAY;
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)
{

Loading…
Cancel
Save