@@ -59,6 +59,11 @@ internal sealed class Configuration
59
59
60
60
internal Status Status { get ; set ; }
61
61
62
+ /// <summary>
63
+ /// How many threads to run at once for file reader?
64
+ /// </summary>
65
+ internal int FileReaderParallelism { get ; set ; }
66
+
62
67
63
68
internal static Configuration Parse ( string iniFile )
64
69
{
@@ -68,14 +73,17 @@ internal static Configuration Parse(string iniFile)
68
73
HeaderFile = IniReader . ReadValue ( "ListMagic" , "HeaderFile" , iniFile ) ,
69
74
Trigger = IniReader . ReadValue ( "ListMagic" , "trigger" , iniFile ) ,
70
75
OutputFolder = IniReader . ReadValue ( "ListMagic" , "ListLocation" , iniFile ) ,
71
- ShowUi = IniReader . ReadValue ( "ListMagic" , "Auto" , iniFile ) == "N" ,
76
+ ShowUi = string . Compare ( IniReader . ReadValue ( "ListMagic" , "Auto" , iniFile , "Y" ) . Trim ( ) , "N" , StringComparison . OrdinalIgnoreCase ) == 0 ,
72
77
ListName = Path . GetFileNameWithoutExtension ( iniFile ) ,
73
78
FileInfo = ( FileInfoLevel ) Enum . Parse ( typeof ( FileInfoLevel ) , IniReader . ReadValue ( "QuickList" , "FileInfo" , iniFile , nameof ( FileInfoLevel . Size ) ) ) ,
74
79
FolderHandling = ( FolderHandling ) Enum . Parse ( typeof ( FolderHandling ) ,
75
80
IniReader . ReadValue ( "QuickList" , "FolderHandling" , iniFile , nameof ( FolderHandling . PartialFolders ) ) ) ,
76
81
ForceShellMedia = IniReader . ReadValue ( "QuickList" , "ForceShellMedia" , iniFile , "0" ) == "1"
77
82
} ;
78
83
84
+ int . TryParse ( IniReader . ReadValue ( "QuickList" , "FileReaderParallelism" , "0" ) , out var fileReaderParallelism ) ;
85
+ configuration . FileReaderParallelism = fileReaderParallelism <= 0 ? Environment . ProcessorCount : fileReaderParallelism ;
86
+
79
87
var dirsFile = IniReader . ReadValue ( "ListMagic" , "DirsFile" , iniFile ) ;
80
88
81
89
if ( ! File . Exists ( dirsFile ) )
@@ -113,6 +121,7 @@ internal void Update()
113
121
IniReader . WriteValue ( "QuickList" , "FolderHandling" , FolderHandling . ToString ( ) , IniFile ) ;
114
122
IniReader . WriteValue ( "QuickList" , "FileInfo" , FileInfo . ToString ( ) , IniFile ) ;
115
123
IniReader . WriteValue ( "QuickList" , "ForceShellMedia" , ForceShellMedia ? "1" : "0" , IniFile ) ;
124
+ IniReader . WriteValue ( "QuickList" , "FileReaderParallelism" , FileReaderParallelism . ToString ( ) , IniFile ) ;
116
125
}
117
126
}
118
127
}
0 commit comments