From 6913d75792585bab7f0c649dd6b5687e05753d33 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 6 Sep 2024 18:04:11 +0900 Subject: [PATCH] Add 'yes'/'no' acronyms to the `played=` filter --- osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs | 4 ++++ osu.Game/Screens/Select/FilterQueryParser.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs b/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs index e6006b7fd2..9ecfa72947 100644 --- a/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs +++ b/osu.Game.Tests/NonVisual/Filtering/FilterQueryParserTest.cs @@ -633,11 +633,15 @@ public void TestOutOfRangeDateQuery() new object[] { "0", DateTimeOffset.Now, false }, new object[] { "false", DateTimeOffset.MinValue, true }, new object[] { "false", DateTimeOffset.Now, false }, + new object[] { "no", DateTimeOffset.MinValue, true }, + new object[] { "no", DateTimeOffset.Now, false }, new object[] { "1", DateTimeOffset.MinValue, false }, new object[] { "1", DateTimeOffset.Now, true }, new object[] { "true", DateTimeOffset.MinValue, false }, new object[] { "true", DateTimeOffset.Now, true }, + new object[] { "yes", DateTimeOffset.MinValue, false }, + new object[] { "yes", DateTimeOffset.Now, true }, }; [Test] diff --git a/osu.Game/Screens/Select/FilterQueryParser.cs b/osu.Game/Screens/Select/FilterQueryParser.cs index 3e0dba59f0..6c9a95a250 100644 --- a/osu.Game/Screens/Select/FilterQueryParser.cs +++ b/osu.Game/Screens/Select/FilterQueryParser.cs @@ -159,10 +159,12 @@ private static bool tryParseBool(string value, out bool result) switch (value) { case "1": + case "yes": result = true; return true; case "0": + case "no": result = false; return true;