mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-23 06:20:50 +00:00
parent
6ba4ec1ae7
commit
af21f4859b
4 changed files with 9 additions and 2 deletions
|
@ -125,6 +125,7 @@ public void should_parse_flac_quality(string title, string desc, int bitrate)
|
|||
[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("[TR24][OF] Good Charlotte - Generation Rx - 2018 (Pop-Punk | Alternative Rock)", null, 0, 0)]
|
||||
public void should_parse_flac_24bit_quality(string title, string desc, int bitrate, int sampleSize)
|
||||
{
|
||||
ParseAndVerifyQuality(title, desc, bitrate, Quality.FLAC_24, sampleSize);
|
||||
|
|
|
@ -14,6 +14,7 @@ public class ReleaseGroupParserFixture : CoreTest
|
|||
[TestCase("Olafur.Arnalds-Remember-WEB-2018-ENTiTLED-Pre", "ENTiTLED")]
|
||||
[TestCase("Olafur.Arnalds-Remember-WEB-2018-ENTiTLED-postbot", "ENTiTLED")]
|
||||
[TestCase("Olafur.Arnalds-Remember-WEB-2018-ENTiTLED-xpost", "ENTiTLED")]
|
||||
[TestCase("[TR24][OF] Good Charlotte - Generation Rx - 2018", null)]
|
||||
|
||||
// [TestCase("", "")]
|
||||
public void should_parse_release_group(string title, string expected)
|
||||
|
|
|
@ -176,6 +176,10 @@ public static class Parser
|
|||
string.Empty,
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly RegexReplace ReleaseTokenPrefixRegex = new RegexReplace(@"^(\[(TR24|OF)\])*\s*",
|
||||
string.Empty,
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex AirDateRegex = new Regex(@"^(.*?)(?<!\d)((?<airyear>\d{4})[_.-](?<airmonth>[0-1][0-9])[_.-](?<airday>[0-3][0-9])|(?<airmonth>[0-1][0-9])[_.-](?<airday>[0-3][0-9])[_.-](?<airyear>\d{4}))(?!\d)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
|
@ -536,6 +540,7 @@ public static string ParseReleaseGroup(string title)
|
|||
title = title.Trim();
|
||||
title = RemoveFileExtension(title);
|
||||
title = WebsitePrefixRegex.Replace(title);
|
||||
title = ReleaseTokenPrefixRegex.Replace(title);
|
||||
|
||||
var animeMatch = AnimeReleaseGroupRegex.Match(title);
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ public class QualityParser
|
|||
(?<VBRV2>V2[ ]?kbps|V2|[\[\(].*V2.*[\]\)]))\b",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
|
||||
|
||||
private static readonly Regex SampleSizeRegex = new Regex(@"\b(?:(?<S24>24[ ]?bit|24-(?:44|48|96|192)|[\[\(].*24bit.*[\]\)]))\b", RegexOptions.Compiled);
|
||||
private static readonly Regex SampleSizeRegex = new Regex(@"\b(?:(?<S24>24[ ]?bit|tr24|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|TR24)|(?<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);
|
||||
|
||||
private static readonly Regex WebRegex = new Regex(@"\b(?<web>WEB)(?:\b|$|[ .])",
|
||||
|
|
Loading…
Reference in a new issue