Skip to content

Commit fa971c6

Browse files
TheBestPessimistTheBestPessimist
authored andcommitted
Ask Everything for RunCount only if sorting by it
1 parent a1a4c72 commit fa971c6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,16 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
115115

116116
EverythingApiDllImport.Everything_SetSort(option.SortOption);
117117
EverythingApiDllImport.Everything_SetMatchPath(option.IsFullPathSearch);
118+
119+
if (option.SortOption == SortOption.RUN_COUNT_DESCENDING)
120+
{
121+
EverythingApiDllImport.Everything_SetRequestFlags(EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME | EVERYTHING_REQUEST_RUN_COUNT);
122+
}
123+
else
124+
{
125+
EverythingApiDllImport.Everything_SetRequestFlags(EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME);
126+
}
118127

119-
EverythingApiDllImport.Everything_SetRequestFlags(EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME | EVERYTHING_REQUEST_RUN_COUNT); // todo need flag for this?
120128

121129

122130
if (token.IsCancellationRequested) yield break;
@@ -143,7 +151,6 @@ public static async IAsyncEnumerable<SearchResult> SearchAsync(EverythingSearchO
143151
Type = EverythingApiDllImport.Everything_IsFolderResult(idx) ? ResultType.Folder :
144152
EverythingApiDllImport.Everything_IsFileResult(idx) ? ResultType.File :
145153
ResultType.Volume,
146-
// todo need flag for this?
147154
Score = (int)EverythingApiDllImport.Everything_GetResultRunCount( (uint)idx)
148155
};
149156

0 commit comments

Comments
 (0)