Fixed: Correctly detect additional cases of Flac 24bit

pull/3310/head
Qstick 2 years ago
parent 9fe13a2d14
commit 8e9f56716b

@ -120,6 +120,10 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Beck.-.Guero.2005.[2016.Remastered].24bit.96kHz.LOSSLESS.FLAC", null, 0, 0)] [TestCase("Beck.-.Guero.2005.[2016.Remastered].24bit.96kHz.LOSSLESS.FLAC", null, 0, 0)]
[TestCase("[R.E.M - Lifes Rich Pageant(1986) [24bit192kHz 2016 Remaster]LOSSLESS FLAC]", null, 0, 0)] [TestCase("[R.E.M - Lifes Rich Pageant(1986) [24bit192kHz 2016 Remaster]LOSSLESS FLAC]", null, 0, 0)]
[TestCase("Kid_Cudi-Entergalactic-24BIT-WEBFLAC-2022-NACHOS", null, 0, 0)] [TestCase("Kid_Cudi-Entergalactic-24BIT-WEBFLAC-2022-NACHOS", null, 0, 0)]
[TestCase("Foghat-Foghat_Live-24-192-WEB-FLAC-REMASTERED-2016-OBZEN", null, 0, 0)]
[TestCase("John Mellencamp-Plain Spoken From The Chicago Theatre-24-48-WEB-FLAC-2018-OBZEN", null, 0, 0)]
[TestCase("Nazareth-Close Enough For Rock N Roll-24-96-WEB-FLAC-REMASTERED-2021-OBZEN", null, 0, 0)]
[TestCase("Green_Day-Father_Of_All-24-44-WEB-FLAC-2020-OBZEN", null, 0, 0)]
[TestCase("", "Flac Audio", 5057, 24)] [TestCase("", "Flac Audio", 5057, 24)]
public void should_parse_flac_24bit_quality(string title, string desc, int bitrate, int sampleSize) public void should_parse_flac_24bit_quality(string title, string desc, int bitrate, int sampleSize)
{ {

@ -38,7 +38,7 @@ namespace NzbDrone.Core.Parser
(?<VBRV2>V2[ ]?kbps|V2|[\[\(].*V2.*[\]\)]))\b", (?<VBRV2>V2[ ]?kbps|V2|[\[\(].*V2.*[\]\)]))\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
private static readonly Regex SampleSizeRegex = new Regex(@"\b(?:(?<S24>24[ ]bit|24bit|[\[\(].*24bit.*[\]\)]))"); private static readonly Regex SampleSizeRegex = new Regex(@"\b(?:(?<S24>24[ ]?bit|24-(?:44|48|96|192)|[\[\(].*24bit.*[\]\)]))\b", RegexOptions.Compiled);
private static readonly Regex CodecRegex = new Regex(@"\b(?:(?<MP1>MPEG Version \d(.5)? Audio, Layer 1|MP1)|(?<MP2>MPEG Version \d(.5)? Audio, Layer 2|MP2)|(?<MP3VBR>MP3.*VBR|MPEG Version \d(.5)? Audio, Layer 3 vbr)|(?<MP3CBR>MP3|MPEG Version \d(.5)? Audio, Layer 3)|(?<FLAC>(web)?flac)|(?<WAVPACK>wavpack|wv)|(?<ALAC>alac)|(?<WMA>WMA\d?)|(?<WAV>WAV|PCM)|(?<AAC>M4A|M4P|M4B|AAC|mp4a|MPEG-4 Audio(?!.*alac))|(?<OGG>OGG|OGA|Vorbis))\b|(?<APE>monkey's audio|[\[|\(].*\bape\b.*[\]|\)])|(?<OPUS>Opus Version \d(.5)? Audio|[\[|\(].*\bopus\b.*[\]|\)])", private static readonly Regex CodecRegex = new Regex(@"\b(?:(?<MP1>MPEG Version \d(.5)? Audio, Layer 1|MP1)|(?<MP2>MPEG Version \d(.5)? Audio, Layer 2|MP2)|(?<MP3VBR>MP3.*VBR|MPEG Version \d(.5)? Audio, Layer 3 vbr)|(?<MP3CBR>MP3|MPEG Version \d(.5)? Audio, Layer 3)|(?<FLAC>(web)?flac)|(?<WAVPACK>wavpack|wv)|(?<ALAC>alac)|(?<WMA>WMA\d?)|(?<WAV>WAV|PCM)|(?<AAC>M4A|M4P|M4B|AAC|mp4a|MPEG-4 Audio(?!.*alac))|(?<OGG>OGG|OGA|Vorbis))\b|(?<APE>monkey's audio|[\[|\(].*\bape\b.*[\]|\)])|(?<OPUS>Opus Version \d(.5)? Audio|[\[|\(].*\bopus\b.*[\]|\)])",
RegexOptions.Compiled | RegexOptions.IgnoreCase); RegexOptions.Compiled | RegexOptions.IgnoreCase);

Loading…
Cancel
Save