New: Parsing of '[WEB]' as WebDL

pull/4253/head
Mark McDowall 4 years ago
parent 8077434a38
commit ba2ca7ee29

@ -3,7 +3,6 @@ using NUnit.Framework;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.ParserTests
{
@ -88,6 +87,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Da.Vincis.Demons.S02E04.480p.WEB.DL.nSD.x264-NhaNc3", false)]
[TestCase("Incorporated.S01E08.Das.geloeschte.Ich.German.Dubbed.DL.AmazonHD.x264-TVS", false)]
[TestCase("Haters.Back.Off.S01E04.Rod.Trip.mit.meinem.Onkel.German.DL.NetflixUHD.x264", false)]
[TestCase("[HorribleSubs] Series Title! S01 [Web][MKV][h264][480p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
public void should_parse_webdl480p_quality(string title, bool proper)
{
ParseAndVerifyQuality(title, Quality.WEBDL480p, proper);
@ -193,6 +193,8 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("into.the.badlands.s03e16.h264.720p-web-handbrake.mkv", false)]
[TestCase("BrainDead.S01E01.The.Insanity.Principle.720p.WEB-DL.DD5.1.H.264-BD", false)]
[TestCase("Jerks.S03E05.Griebnitzsee.German.720p.MaxdomeHD.AVC-TVS", false)]
[TestCase("[HorribleSubs] Series Title! S01 [Web][MKV][h264][720p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
[TestCase("[HorribleSubs] Series Title! S01 [Web][MKV][h264][AAC 2.0][Softsubs (HorribleSubs)]", false)]
public void should_parse_webdl720p_quality(string title, bool proper)
{
ParseAndVerifyQuality(title, Quality.WEBDL720p, proper);
@ -230,6 +232,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Legacies.S02E02.This.Year.Will.Be.Different.1080p.AMZN.WEB...", false)]
[TestCase("Legacies.S02E02.This.Year.Will.Be.Different.1080p.AMZN.WEB.", false)]
[TestCase("Series Title - S01E11 2020 1080p Viva MKV WEB", false)]
[TestCase("[HorribleSubs] Series Title! S01 [Web][MKV][h264][1080p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
public void should_parse_webdl1080p_quality(string title, bool proper)
{
ParseAndVerifyQuality(title, Quality.WEBDL1080p, proper);
@ -251,6 +254,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("The.Nightly.Show.2016.03.14.2160p.WEB.PROPER.h264-spamTV", true)]
[TestCase("House.of.Cards.US.s05e13.4K.UHD.WEB.DL", false)]
[TestCase("House.of.Cards.US.s05e13.UHD.4K.WEB.DL", false)]
[TestCase("[HorribleSubs] Series Title! S01 [Web][MKV][h264][2160p][AAC 2.0][Softsubs (HorribleSubs)]", false)]
public void should_parse_webdl2160p_quality(string title, bool proper)
{
ParseAndVerifyQuality(title, Quality.WEBDL2160p, proper);

@ -59,6 +59,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex OtherSourceRegex = new Regex(@"(?<hdtv>HD[-_. ]TV)|(?<sdtv>SD[-_. ]TV)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex AnimeBlurayRegex = new Regex(@"bd(?:720|1080|2160)|(?<=[-_. (\[])bd(?=[-_. )\]])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex AnimeWebDlRegex = new Regex(@"\[WEB\]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex HighDefPdtvRegex = new Regex(@"hr[-_. ]ws", RegexOptions.Compiled | RegexOptions.IgnoreCase);
@ -341,6 +342,39 @@ namespace NzbDrone.Core.Parser
return result;
}
if (AnimeWebDlRegex.Match(normalizedName).Success)
{
result.SourceDetectionSource = QualityDetectionSource.Name;
if (resolution == Resolution.R360P || resolution == Resolution.R480P ||
resolution == Resolution.R576p || normalizedName.ContainsIgnoreCase("480p"))
{
result.ResolutionDetectionSource = QualityDetectionSource.Name;
result.Quality = Quality.WEBDL480p;
return result;
}
if (resolution == Resolution.R1080p || normalizedName.ContainsIgnoreCase("1080p"))
{
result.ResolutionDetectionSource = QualityDetectionSource.Name;
result.Quality = Quality.WEBDL1080p;
return result;
}
if (resolution == Resolution.R2160p || normalizedName.ContainsIgnoreCase("2160p"))
{
result.ResolutionDetectionSource = QualityDetectionSource.Name;
result.Quality = Quality.WEBDL2160p;
return result;
}
result.Quality = Quality.WEBDL720p;
return result;
}
if (resolution != Resolution.Unknown)
{
var source = QualitySource.Unknown;

Loading…
Cancel
Save