From 7c04e8bfba9da67118ae3ffc28abe6e2de04191b Mon Sep 17 00:00:00 2001 From: Stoppedpuma <58333920+Stoppedpuma@users.noreply.github.com> Date: Sat, 10 Feb 2024 07:48:24 +0100 Subject: [PATCH 1/3] Alias author to creator Allows "author" to show the results of "creator" --- osu.Game/Screens/Select/FilterQueryParser.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Select/FilterQueryParser.cs b/osu.Game/Screens/Select/FilterQueryParser.cs index 0d8905347b..f6023c0b61 100644 --- a/osu.Game/Screens/Select/FilterQueryParser.cs +++ b/osu.Game/Screens/Select/FilterQueryParser.cs @@ -68,6 +68,7 @@ namespace osu.Game.Screens.Select return TryUpdateCriteriaRange(ref criteria.OnlineStatus, op, value, tryParseEnum); case "creator": + case "author": return TryUpdateCriteriaText(ref criteria.Creator, op, value); case "artist": From ca0819cf7a4529fc27a71d9e9e6ff4ff3a25ff3f Mon Sep 17 00:00:00 2001 From: Stoppedpuma <58333920+Stoppedpuma@users.noreply.github.com> Date: Sun, 11 Feb 2024 20:28:16 +0100 Subject: [PATCH 2/3] Alias "mapper" as well --- osu.Game/Screens/Select/FilterQueryParser.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Select/FilterQueryParser.cs b/osu.Game/Screens/Select/FilterQueryParser.cs index f6023c0b61..5d3ff1261f 100644 --- a/osu.Game/Screens/Select/FilterQueryParser.cs +++ b/osu.Game/Screens/Select/FilterQueryParser.cs @@ -69,6 +69,7 @@ namespace osu.Game.Screens.Select case "creator": case "author": + case "mapper": return TryUpdateCriteriaText(ref criteria.Creator, op, value); case "artist": From 96711eb185c0692868dc924b6b4368e8e1a8735d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 12 Feb 2024 18:02:34 +0100 Subject: [PATCH 3/3] Add test coverage --- .../NonVisual/Filtering/FilterQueryParserTest.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs b/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs index 739a72df08..899be1e06c 100644 --- a/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs +++ b/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs @@ -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());