Add the ability to search for local beatmaps via online IDs

Closes #10470.
This commit is contained in:
Dean Herbert
2020-10-10 21:34:01 +09:00
parent 8507327fa6
commit 73c238fae3
2 changed files with 18 additions and 0 deletions

View File

@ -58,6 +58,14 @@ namespace osu.Game.Screens.Select.Carousel
foreach (var criteriaTerm in criteria.SearchTerms)
match &= terms.Any(term => term.IndexOf(criteriaTerm, StringComparison.InvariantCultureIgnoreCase) >= 0);
// if a match wasn't found via text matching of terms, do a second catch-all check matching against online IDs.
// this should be done after text matching so we can prioritise matching numbers in metadata.
if (!match && criteria.SearchNumber.HasValue)
{
match = (Beatmap.OnlineBeatmapID == criteria.SearchNumber.Value) ||
(Beatmap.BeatmapSet?.OnlineBeatmapSetID == criteria.SearchNumber.Value);
}
}
if (match)