Skip to content

Commit

Permalink
Add support for removing selected count from score
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack251970 committed Dec 23, 2024
1 parent b5e401f commit 4ad967b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Flow.Launcher.Plugin/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ public ValueTask<bool> ExecuteAsync(ActionContext context)
/// </summary>
public PreviewInfo Preview { get; set; } = PreviewInfo.Default;

/// <summary>
/// Determines if the selected count should be added to the score
/// </summary>
public bool AddSelectedCount { get; set; } = true;

/// <summary>
/// Info of the preview section of a <see cref="Result"/>
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,9 @@ public void UpdateResultView(ICollection<ResultsForUpdate> resultsForUpdates)
else if (result.Score != int.MaxValue)
{
var priorityScore = metaResults.Metadata.Priority * 150;
result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore;
result.Score += result.AddSelectedCount ?
_userSelectedRecord.GetSelectedCount(result) + priorityScore :
priorityScore;
}
}
}
Expand Down

0 comments on commit 4ad967b

Please sign in to comment.