Skip to content

Commit 10fd7a4

Browse files
bakerboy448mynameisbogdan
authored andcommittedDec 23, 2023
QualityParser - Simplify new expression (IDE0090)
(cherry picked from commit 9ae647d9d23bcd53ef34ba6eeffd0cf17248404d) Closes #3479
1 parent d000dcf commit 10fd7a4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎src/NzbDrone.Core/Parser/QualityParser.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ public class QualityParser
1212
{
1313
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(QualityParser));
1414

15-
private static readonly Regex ProperRegex = new Regex(@"\b(?<proper>proper)\b",
15+
private static readonly Regex ProperRegex = new (@"\b(?<proper>proper)\b",
1616
RegexOptions.Compiled | RegexOptions.IgnoreCase);
1717

18-
private static readonly Regex RepackRegex = new Regex(@"\b(?<repack>repack\d?|rerip\d?)\b",
18+
private static readonly Regex RepackRegex = new (@"\b(?<repack>repack\d?|rerip\d?)\b",
1919
RegexOptions.Compiled | RegexOptions.IgnoreCase);
2020

21-
private static readonly Regex VersionRegex = new Regex(@"\d[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]|repack(?<version>\d)|rerip(?<version>\d)",
21+
private static readonly Regex VersionRegex = new (@"\d[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]|repack(?<version>\d)|rerip(?<version>\d)",
2222
RegexOptions.Compiled | RegexOptions.IgnoreCase);
2323

24-
private static readonly Regex RealRegex = new Regex(@"\b(?<real>REAL)\b",
24+
private static readonly Regex RealRegex = new (@"\b(?<real>REAL)\b",
2525
RegexOptions.Compiled);
2626

27-
private static readonly Regex BitRateRegex = new Regex(@"\b(?:(?<B096>96[ ]?kbps|96|[\[\(].*96.*[\]\)])|
27+
private static readonly Regex BitRateRegex = new (@"\b(?:(?<B096>96[ ]?kbps|96|[\[\(].*96.*[\]\)])|
2828
(?<B128>128[ ]?kbps|128|[\[\(].*128.*[\]\)])|
2929
(?<B160>160[ ]?kbps|160|[\[\(].*160.*[\]\)]|q5)|
3030
(?<B192>192[ ]?kbps|192|[\[\(].*192.*[\]\)]|q6)|
@@ -36,12 +36,12 @@ public class QualityParser
3636
(?<VBRV2>V2[ ]?kbps|V2|[\[\(].*V2.*[\]\)]))\b",
3737
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
3838

39-
private static readonly Regex SampleSizeRegex = new Regex(@"\b(?:(?<S24>24[ ]?bit|tr24|24-(?:44|48|96|192)|[\[\(].*24bit.*[\]\)]))\b", RegexOptions.Compiled);
39+
private static readonly Regex SampleSizeRegex = new (@"\b(?:(?<S24>24[ ]?bit|tr24|24-(?:44|48|96|192)|[\[\(].*24bit.*[\]\)]))\b", RegexOptions.Compiled);
4040

41-
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.*[\]|\)])",
41+
private static readonly Regex CodecRegex = new (@"\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.*[\]|\)])",
4242
RegexOptions.Compiled | RegexOptions.IgnoreCase);
4343

44-
private static readonly Regex WebRegex = new Regex(@"\b(?<web>WEB)(?:\b|$|[ .])",
44+
private static readonly Regex WebRegex = new (@"\b(?<web>WEB)(?:\b|$|[ .])",
4545
RegexOptions.Compiled | RegexOptions.IgnoreCase);
4646

4747
public static QualityModel ParseQuality(string name, string desc, int fileBitrate, int fileSampleSize = 0)

0 commit comments

Comments
 (0)
Please sign in to comment.