diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 640049fb9..0dafda8d0 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -78,6 +78,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Ricardo Arjona - APNEA (Single 2014) (320 kbps)", null, 0)] [TestCase("Kehlani - SweetSexySavage (Deluxe Edition) (2017) 320", null, 0)] [TestCase("Anderson Paak - Malibu (320)(2016)", null, 0)] + [TestCase("Zeynep_Erbay-Flashlights_On_Love-WEB-2022-BABAS", null, 0)] [TestCase("", "MPEG Version 1 Audio, Layer 3", 320)] public void should_parse_mp3_320_quality(string title, string desc, int bitrate) { diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 34083fecc..e6c5174c3 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -43,6 +43,9 @@ namespace NzbDrone.Core.Parser private static readonly Regex CodecRegex = new Regex(@"\b(?:(?MPEG Version \d(.5)? Audio, Layer 1|MP1)|(?MPEG Version \d(.5)? Audio, Layer 2|MP2)|(?MP3.*VBR|MPEG Version \d(.5)? Audio, Layer 3 vbr)|(?MP3|MPEG Version \d(.5)? Audio, Layer 3)|(?(web)?flac)|(?wavpack|wv)|(?alac)|(?WMA\d?)|(?WAV|PCM)|(?M4A|M4P|M4B|AAC|mp4a|MPEG-4 Audio(?!.*alac))|(?OGG|OGA|Vorbis))\b|(?monkey's audio|[\[|\(].*\bape\b.*[\]|\)])|(?Opus Version \d(.5)? Audio|[\[|\(].*\bopus\b.*[\]|\)])", RegexOptions.Compiled | RegexOptions.IgnoreCase); + private static readonly Regex WebRegex = new Regex(@"\b(?WEB)(?:\b|$|[ .])", + RegexOptions.Compiled | RegexOptions.IgnoreCase); + public static QualityModel ParseQuality(string name, string desc, int fileBitrate, int fileSampleSize = 0) { Logger.Debug("Trying to parse quality for {0}", name); @@ -219,7 +222,14 @@ namespace NzbDrone.Core.Parser } else { - result.Quality = Quality.Unknown; + if (WebRegex.IsMatch(normalizedName)) + { + result.Quality = Quality.MP3_320; + } + else + { + result.Quality = Quality.Unknown; + } } break;