Add 'yes'/'no' acronyms to the `played=` filter

This commit is contained in:
Dan Balasescu 2024-09-06 18:04:11 +09:00
parent 925710d9b3
commit 6913d75792
No known key found for this signature in database
2 changed files with 6 additions and 0 deletions

View File

@ -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]

View File

@ -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;