mirror of
https://github.com/ppy/osu
synced 2024-12-17 20:35:21 +00:00
Add missing source query filter in song select
This commit is contained in:
parent
7c94973d4a
commit
465cc716d3
@ -509,6 +509,8 @@ namespace osu.Game.Tests.NonVisual.Filtering
|
||||
FilterQueryParser.ApplyQueries(filterCriteria, query);
|
||||
Assert.AreEqual("find me songs with please", filterCriteria.SearchText.Trim());
|
||||
Assert.AreEqual(5, filterCriteria.SearchTerms.Length);
|
||||
Assert.AreEqual("unit tests", filterCriteria.Source.SearchTerm);
|
||||
Assert.That(filterCriteria.Source.MatchMode, Is.EqualTo(FilterCriteria.MatchMode.IsolatedPhrase));
|
||||
}
|
||||
|
||||
private class CustomFilterCriteria : IRulesetFilterCriteria
|
||||
|
@ -81,6 +81,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
match &= !criteria.Title.HasFilter || criteria.Title.Matches(BeatmapInfo.Metadata.Title) ||
|
||||
criteria.Title.Matches(BeatmapInfo.Metadata.TitleUnicode);
|
||||
match &= !criteria.DifficultyName.HasFilter || criteria.DifficultyName.Matches(BeatmapInfo.DifficultyName);
|
||||
match &= !criteria.Source.HasFilter || criteria.Source.Matches(BeatmapInfo.Metadata.Source);
|
||||
match &= !criteria.UserStarDifficulty.HasFilter || criteria.UserStarDifficulty.IsInRange(BeatmapInfo.StarRating);
|
||||
|
||||
if (!match) return false;
|
||||
|
@ -43,6 +43,7 @@ namespace osu.Game.Screens.Select
|
||||
public OptionalTextFilter Artist;
|
||||
public OptionalTextFilter Title;
|
||||
public OptionalTextFilter DifficultyName;
|
||||
public OptionalTextFilter Source;
|
||||
|
||||
public OptionalRange<double> UserStarDifficulty = new OptionalRange<double>
|
||||
{
|
||||
|
@ -113,6 +113,9 @@ namespace osu.Game.Screens.Select
|
||||
case "diff":
|
||||
return TryUpdateCriteriaText(ref criteria.DifficultyName, op, value);
|
||||
|
||||
case "source":
|
||||
return TryUpdateCriteriaText(ref criteria.Source, op, value);
|
||||
|
||||
default:
|
||||
return criteria.RulesetCriteria?.TryParseCustomKeywordCriteria(key, op, value) ?? false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user