@@ -38,13 +38,13 @@ public static string GetPathWithActionKeyword(string path, ResultType type, stri
38
38
39
39
var keyword = usePathSearchActionKeyword ? pathSearchActionKeyword : searchActionKeyword ;
40
40
41
- var formatted_path = path ;
41
+ var formattedPath = path ;
42
42
43
43
if ( type == ResultType . Folder )
44
44
// the separator is needed so when navigating the folder structure contents of the folder are listed
45
- formatted_path = path . EndsWith ( Constants . DirectorySeparator ) ? path : path + Constants . DirectorySeparator ;
45
+ formattedPath = path . EndsWith ( Constants . DirectorySeparator ) ? path : path + Constants . DirectorySeparator ;
46
46
47
- return $ "{ keyword } { formatted_path } ";
47
+ return $ "{ keyword } { formattedPath } ";
48
48
}
49
49
50
50
public static string GetAutoCompleteText ( string title , Query query , string path , ResultType resultType )
@@ -70,7 +70,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
70
70
{
71
71
return new Result
72
72
{
73
- Title = title + _addScoreInDebug ( score ) ,
73
+ Title = title ,
74
74
IcoPath = path ,
75
75
SubTitle = subtitle ,
76
76
AutoCompleteText = GetAutoCompleteText ( title , query , path , ResultType . Folder ) ,
@@ -109,7 +109,6 @@ internal static Result CreateDriveSpaceDisplayResult(string path, string actionK
109
109
var progressBarColor = "#26a0da" ;
110
110
var title = string . Empty ; // hide title when use progress bar,
111
111
var driveLetter = path [ ..1 ] . ToUpper ( ) ;
112
- var driveName = driveLetter + ":\\ " ;
113
112
DriveInfo drv = new DriveInfo ( driveLetter ) ;
114
113
var freespace = ToReadableSize ( drv . AvailableFreeSpace , 2 ) ;
115
114
var totalspace = ToReadableSize ( drv . TotalSize , 2 ) ;
@@ -130,7 +129,7 @@ internal static Result CreateDriveSpaceDisplayResult(string path, string actionK
130
129
Score = 500 ,
131
130
ProgressBar = progressValue ,
132
131
ProgressBarColor = progressBarColor ,
133
- Action = c =>
132
+ Action = _ =>
134
133
{
135
134
_openFolder ( path ) ;
136
135
return true ;
@@ -145,7 +144,7 @@ private static string ToReadableSize(long pDrvSize, int pi)
145
144
{
146
145
int mok = 0 ;
147
146
double drvSize = pDrvSize ;
148
- string Space = "Byte" ;
147
+ string space = "Byte" ;
149
148
150
149
while ( drvSize > 1024.0 )
151
150
{
@@ -154,23 +153,23 @@ private static string ToReadableSize(long pDrvSize, int pi)
154
153
}
155
154
156
155
if ( mok == 1 )
157
- Space = "KB" ;
156
+ space = "KB" ;
158
157
else if ( mok == 2 )
159
- Space = " MB" ;
158
+ space = " MB" ;
160
159
else if ( mok == 3 )
161
- Space = " GB" ;
160
+ space = " GB" ;
162
161
else if ( mok == 4 )
163
- Space = " TB" ;
162
+ space = " TB" ;
164
163
165
- var returnStr = $ "{ Convert . ToInt32 ( drvSize ) } { Space } ";
164
+ var returnStr = $ "{ Convert . ToInt32 ( drvSize ) } { space } ";
166
165
if ( mok != 0 )
167
166
{
168
167
returnStr = pi switch
169
168
{
170
- 1 => $ "{ drvSize : F1} { Space } ",
171
- 2 => $ "{ drvSize : F2} { Space } ",
172
- 3 => $ "{ drvSize : F3} { Space } ",
173
- _ => $ "{ Convert . ToInt32 ( drvSize ) } { Space } "
169
+ 1 => $ "{ drvSize : F1} { space } ",
170
+ 2 => $ "{ drvSize : F2} { space } ",
171
+ 3 => $ "{ drvSize : F3} { space } ",
172
+ _ => $ "{ Convert . ToInt32 ( drvSize ) } { space } "
174
173
} ;
175
174
}
176
175
@@ -202,11 +201,11 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK
202
201
203
202
internal static Result CreateFileResult ( string filePath , Query query , int score = 0 , bool windowsIndexed = false )
204
203
{
205
- Result . PreviewInfo preview = IsMedia ( Path . GetExtension ( filePath ) )
204
+ Result . PreviewInfo preview = _isMedia ( Path . GetExtension ( filePath ) )
206
205
? new Result . PreviewInfo { IsMedia = true , PreviewImagePath = filePath , }
207
206
: Result . PreviewInfo . Default ;
208
207
209
- var title = Path . GetFileName ( filePath ) + _addScoreInDebug ( score ) ;
208
+ var title = Path . GetFileName ( filePath ) ;
210
209
211
210
var result = new Result
212
211
{
@@ -250,7 +249,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
250
249
return result ;
251
250
}
252
251
253
- public static bool IsMedia ( string extension )
252
+ private static bool _isMedia ( string extension )
254
253
{
255
254
if ( string . IsNullOrEmpty ( extension ) )
256
255
{
@@ -302,16 +301,7 @@ private static void _incrementEverythingRunCounterIfNeeded(string fileOrFolder)
302
301
_ = Task . Run ( ( ) => EverythingApi . IncrementRunCounterAsync ( fileOrFolder ) ) ;
303
302
}
304
303
305
- private static string _addScoreInDebug ( int score )
306
- {
307
- #if DEBUG
308
- return $ " ➡️ { score } ";
309
- #else
310
- return "" ;
311
- #endif
312
- }
313
-
314
- public static readonly string [ ] MediaExtensions = { ".jpg" , ".png" , ".avi" , ".mkv" , ".bmp" , ".gif" , ".wmv" , ".mp3" , ".flac" , ".mp4" } ;
304
+ private static readonly string [ ] MediaExtensions = { ".jpg" , ".png" , ".avi" , ".mkv" , ".bmp" , ".gif" , ".wmv" , ".mp3" , ".flac" , ".mp4" } ;
315
305
}
316
306
317
307
public enum ResultType
0 commit comments