@@ -51,8 +51,8 @@ public AudioMetadataHandler(string originalPath)
5151 {
5252 AudioFormat . AAC ,
5353 bitrate => bitrate < 256
54- ? new [ ] { $ "-b:a { bitrate } k" }
55- : new [ ] { "-q:a 2" } // 2 is highest quality for AAC
54+ ? [ $ "-b:a { bitrate } k"]
55+ : [ "-q:a 2" ] // 2 is highest quality for AAC
5656 } ,
5757
5858 {
@@ -70,42 +70,39 @@ public AudioMetadataHandler(string originalPath)
7070 >= 65 => 8 , // V8 (~65-105kbps)
7171 _ => 9 // V9 (~45-85kbps)
7272 } ;
73- return new [ ] { $ "-q:a { qualityLevel } " } ;
73+ return [ $ "-q:a { qualityLevel } "] ;
7474 }
7575 } ,
7676
7777 {
7878 AudioFormat . Opus ,
79- bitrate => new [ ] {
80- $ "-b:a { bitrate } k",
81- "-compression_level 10"
82- }
79+ bitrate => [ $ "-b:a { bitrate } k", "-compression_level 10" ]
8380 } ,
8481
8582 {
8683 AudioFormat . Vorbis ,
87- bitrate => new [ ] { $ "-q:a { AudioFormatHelper . MapBitrateToVorbisQuality ( bitrate ) } " }
84+ bitrate => [ $ "-q:a { AudioFormatHelper . MapBitrateToVorbisQuality ( bitrate ) } "]
8885 } ,
8986
90- { AudioFormat . MP4 , bitrate => new [ ] { $ "-b:a { bitrate } k" } } ,
87+ { AudioFormat . MP4 , bitrate => [ $ "-b:a { bitrate } k"] } ,
9188 {
9289 AudioFormat . OGG ,
93- bitrate => new [ ] { $ "-q:a { AudioFormatHelper . MapBitrateToVorbisQuality ( bitrate ) } " }
90+ bitrate => [ $ "-q:a { AudioFormatHelper . MapBitrateToVorbisQuality ( bitrate ) } "]
9491 } ,
95- { AudioFormat . AMR , bitrate => new [ ] { $ "-ab { bitrate } k" } } ,
96- { AudioFormat . WMA , bitrate => new [ ] { $ "-b:a { bitrate } k" } }
92+ { AudioFormat . AMR , bitrate => [ $ "-ab { bitrate } k"] } ,
93+ { AudioFormat . WMA , bitrate => [ $ "-b:a { bitrate } k"] }
9794 } ;
9895
99- private static readonly string [ ] ExtractionParameters = new [ ]
100- {
96+ private static readonly string [ ] ExtractionParameters =
97+ [
10198 "-codec:a copy" ,
10299 "-vn" ,
103100 "-movflags +faststart"
104- } ;
101+ ] ;
105102
106103
107- private static readonly string [ ] VideoFormats = new [ ]
108- {
104+ private static readonly string [ ] VideoFormats =
105+ [
109106 "matroska" , "webm" , // Matroska/WebM containers
110107 "mov" , "mp4" , "m4a" , // QuickTime/MP4 containers
111108 "avi" , // AVI containers
@@ -114,7 +111,7 @@ public AudioMetadataHandler(string originalPath)
114111 "3gp" , "3g2" , // 3GPP containers
115112 "mxf" , // Material Exchange Format
116113 "ts" , "m2ts" // Transport streams
117- } ;
114+ ] ;
118115
119116 /// <summary>
120117 /// Converts audio to the specified format with optional bitrate control.
@@ -372,7 +369,7 @@ public bool TryEmbedMetadata(Album albumInfo, Track trackInfo)
372369 file . GetTag ( TagLib . TagTypes . Id3v2 ) is TagLib . Id3v2 . Tag id3v2Tag )
373370 {
374371 TagLib . Id3v2 . UserTextInformationFrame mbFrame = TagLib . Id3v2 . UserTextInformationFrame . Get ( id3v2Tag , "MusicBrainz Recording Id" , true ) ;
375- mbFrame . Text = new [ ] { trackInfo . ForeignRecordingId } ;
372+ mbFrame . Text = [ trackInfo . ForeignRecordingId ] ;
376373 }
377374
378375 try
@@ -384,7 +381,7 @@ public bool TryEmbedMetadata(Album albumInfo, Track trackInfo)
384381 Type = TagLib . PictureType . FrontCover ,
385382 Description = "Album Cover"
386383 } ;
387- file . Tag . Pictures = new TagLib . IPicture [ ] { picture } ;
384+ file . Tag . Pictures = [ picture ] ;
388385 }
389386 }
390387 catch ( Exception ex )
@@ -450,7 +447,7 @@ public static bool CheckFFmpegInstalled()
450447
451448 if ( ! string . IsNullOrEmpty ( FFmpeg . ExecutablesPath ) && Directory . Exists ( FFmpeg . ExecutablesPath ) )
452449 {
453- string [ ] ffmpegPatterns = new [ ] { "ffmpeg" , "ffmpeg.exe" , "ffmpeg.bin" } ;
450+ string [ ] ffmpegPatterns = [ "ffmpeg" , "ffmpeg.exe" , "ffmpeg.bin" ] ;
454451 string [ ] files = Directory . GetFiles ( FFmpeg . ExecutablesPath ) ;
455452 if ( files . Any ( file => ffmpegPatterns . Contains ( Path . GetFileName ( file ) , StringComparer . OrdinalIgnoreCase ) && IsExecutable ( file ) ) )
456453 {
@@ -460,11 +457,11 @@ public static bool CheckFFmpegInstalled()
460457
461458 if ( ! isInstalled )
462459 {
463- foreach ( string path in Environment . GetEnvironmentVariable ( "PATH" ) ? . Split ( Path . PathSeparator ) ?? Array . Empty < string > ( ) )
460+ foreach ( string path in Environment . GetEnvironmentVariable ( "PATH" ) ? . Split ( Path . PathSeparator ) ?? [ ] )
464461 {
465462 if ( Directory . Exists ( path ) )
466463 {
467- string [ ] ffmpegPatterns = new [ ] { "ffmpeg" , "ffmpeg.exe" , "ffmpeg.bin" } ;
464+ string [ ] ffmpegPatterns = [ "ffmpeg" , "ffmpeg.exe" , "ffmpeg.bin" ] ;
468465 string [ ] files = Directory . GetFiles ( path ) ;
469466
470467 if ( files . Any ( file => ffmpegPatterns . Contains ( Path . GetFileName ( file ) , StringComparer . OrdinalIgnoreCase ) && IsExecutable ( file ) ) )
0 commit comments