@@ -198,11 +198,13 @@ void OpenFromClipboard(IList<string> args)
198198 else
199199 {
200200 string clipboard = System . Windows . Forms . Clipboard . GetText ( ) ;
201- List < string > files = new List < string > ( ) ;
201+ List < string > files = [ ] ;
202202
203203 foreach ( string i in clipboard . Split ( BR . ToCharArray ( ) , StringSplitOptions . RemoveEmptyEntries ) )
204+ {
204205 if ( i . Contains ( "://" ) || File . Exists ( i ) )
205206 files . Add ( i ) ;
207+ }
206208
207209 if ( files . Count == 0 )
208210 {
@@ -227,9 +229,13 @@ void LoadAudio(IList<string> args)
227229
228230 dialog . Multiselect = true ;
229231
230- if ( dialog . ShowDialog ( ) == DialogResult . OK )
231- foreach ( string i in dialog . FileNames )
232- Player . CommandV ( "audio-add" , i ) ;
232+ if ( dialog . ShowDialog ( ) != DialogResult . OK )
233+ return ;
234+
235+ foreach ( string i in dialog . FileNames )
236+ {
237+ Player . CommandV ( "audio-add" , i ) ;
238+ }
233239 }
234240
235241 void RegisterFileAssociations ( IList < string > args )
@@ -313,9 +319,11 @@ void ShowRecentFilesInCommandPalette()
313319 var items = new List < Item > ( ) ;
314320
315321 foreach ( string file in App . Settings . RecentFiles )
322+ {
316323 items . Add ( new Item ( ) { title = Path . GetFileName ( file ) ,
317- value = new string [ ] { "loadfile" , file } ,
318- hint = file } ) ;
324+ value = [ "loadfile" , file ] ,
325+ hint = file } ) ;
326+ }
319327
320328 o . items = items . ToArray ( ) ;
321329 string json = JsonSerializer . Serialize ( o ) ;
@@ -326,12 +334,12 @@ class Obj
326334 {
327335 public string title { get ; set ; } = "" ;
328336 public int selected_index { get ; set ; } = 0 ;
329- public Item [ ] items { get ; set ; } = Array . Empty < Item > ( ) ;
337+ public Item [ ] items { get ; set ; } = [ ] ;
330338 }
331339
332340 class Item
333341 {
334- public string [ ] value { get ; set ; } = Array . Empty < string > ( ) ;
342+ public string [ ] value { get ; set ; } = [ ] ;
335343 public string title { get ; set ; } = "" ;
336344 public string hint { get ; set ; } = "" ;
337345 }
@@ -393,15 +401,21 @@ void ShowMediaInfo(IList<string> args)
393401 }
394402
395403 if ( App . MediaInfo && ! osd && File . Exists ( path ) && ! path . Contains ( @"\\.\pipe\" ) )
396- using ( MediaInfo mediaInfo = new MediaInfo ( path ) )
397- text = Regex . Replace ( mediaInfo . GetSummary ( full , raw ) , "Unique ID.+" , "" ) ;
404+ {
405+ using MediaInfo mediaInfo = new MediaInfo ( path ) ;
406+ text = Regex . Replace ( mediaInfo . GetSummary ( full , raw ) , "Unique ID.+" , "" ) ;
407+ }
398408 else
399409 {
400410 Player . UpdateExternalTracks ( ) ;
401411 text = "N: " + Player . GetPropertyString ( "filename" ) + BR ;
402412 lock ( Player . MediaTracksLock )
413+ {
403414 foreach ( MediaTrack track in Player . MediaTracks )
415+ {
404416 text += track . Text + BR ;
417+ }
418+ }
405419 }
406420
407421 text = text . TrimEx ( ) ;
@@ -426,7 +440,7 @@ void AddToPath()
426440 {
427441 string path = Environment . GetEnvironmentVariable ( "Path" , EnvironmentVariableTarget . User ) ! ;
428442
429- if ( path . ToLower ( ) . Contains ( Folder . Startup . TrimEnd ( Path . DirectorySeparatorChar ) . ToLower ( ) ) )
443+ if ( path . Contains ( Folder . Startup . TrimEnd ( Path . DirectorySeparatorChar ) , StringComparison . CurrentCultureIgnoreCase ) )
430444 {
431445 Msg . ShowWarning ( _ ( "mpv.net is already in the Path environment variable." ) ) ;
432446 return ;
0 commit comments