Merge pull request #21338 from RATCM/fix-leaderboard-filter

Match leaderboard filter behaviour to web
This commit is contained in:
Dean Herbert 2022-11-21 14:01:55 +09:00 committed by GitHub
commit 4a79141824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,10 +204,11 @@ namespace osu.Game.Screens.Select.Leaderboards
}
else if (filterMods)
{
// otherwise find all the scores that have *any* of the currently selected mods (similar to how web applies mod filters)
// we're creating and using a string list representation of selected mods so that it can be translated into the DB query itself
var selectedMods = mods.Value.Select(m => m.Acronym);
scores = scores.Where(s => s.Mods.Any(m => selectedMods.Contains(m.Acronym)));
// otherwise find all the scores that have all of the currently selected mods (similar to how web applies mod filters)
// we're creating and using a string HashSet representation of selected mods so that it can be translated into the DB query itself
var selectedMods = mods.Value.Select(m => m.Acronym).ToHashSet();
scores = scores.Where(s => selectedMods.SetEquals(s.Mods.Select(m => m.Acronym)));
}
scores = scoreManager.OrderByTotalScore(scores.Detach());