Skip to content

Commit 4ad967b

Browse files
committed
Add support for removing selected count from score
1 parent b5e401f commit 4ad967b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ public ValueTask<bool> ExecuteAsync(ActionContext context)
263263
/// </summary>
264264
public PreviewInfo Preview { get; set; } = PreviewInfo.Default;
265265

266+
/// <summary>
267+
/// Determines if the selected count should be added to the score
268+
/// </summary>
269+
public bool AddSelectedCount { get; set; } = true;
270+
266271
/// <summary>
267272
/// Info of the preview section of a <see cref="Result"/>
268273
/// </summary>

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,9 @@ public void UpdateResultView(ICollection<ResultsForUpdate> resultsForUpdates)
14761476
else if (result.Score != int.MaxValue)
14771477
{
14781478
var priorityScore = metaResults.Metadata.Priority * 150;
1479-
result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore;
1479+
result.Score += result.AddSelectedCount ?
1480+
_userSelectedRecord.GetSelectedCount(result) + priorityScore :
1481+
priorityScore;
14801482
}
14811483
}
14821484
}

0 commit comments

Comments
 (0)