Add support for removing selected count from score

This commit is contained in:
Jack251970 2024-12-23 15:57:59 +08:00
parent b5e401f759
commit 4ad967b5f3
2 changed files with 8 additions and 1 deletions

View file

@ -263,6 +263,11 @@ namespace Flow.Launcher.Plugin
/// </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>

View file

@ -1476,7 +1476,9 @@ namespace Flow.Launcher.ViewModel
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;
}
}
}