1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 18:23:04 +08:00

Merge pull request #27112 from Stoppedpuma/alias-author-creator

Add aliases "author" and "mapper" for creator results
This commit is contained in:
Dan Balasescu 2024-02-13 08:35:49 +09:00 committed by GitHub
commit 60e0eea9bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -274,10 +274,12 @@ namespace osu.Game.Tests.NonVisual.Filtering
Assert.IsTrue(filterCriteria.OnlineStatus.IsUpperInclusive);
}
[Test]
public void TestApplyCreatorQueries()
[TestCase("creator")]
[TestCase("author")]
[TestCase("mapper")]
public void TestApplyCreatorQueries(string keyword)
{
const string query = "beatmap specifically by creator=my_fav";
string query = $"beatmap specifically by {keyword}=my_fav";
var filterCriteria = new FilterCriteria();
FilterQueryParser.ApplyQueries(filterCriteria, query);
Assert.AreEqual("beatmap specifically by", filterCriteria.SearchText.Trim());

View File

@ -68,6 +68,8 @@ namespace osu.Game.Screens.Select
return TryUpdateCriteriaRange(ref criteria.OnlineStatus, op, value, tryParseEnum);
case "creator":
case "author":
case "mapper":
return TryUpdateCriteriaText(ref criteria.Creator, op, value);
case "artist":