New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add last played search filter in song select #23129
Conversation
new object[] { "0.1y0.1M2d" }, | ||
new object[] { "0.99y0.99M2d" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anyone really want or need decimal months/years? Those are possibly the least intuitive units under the sun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with it being not intuitive (except maybe 0.5y). However, as the other units (d, h, m, s) accepts decimals it is to not make the search fail if decimal is used in y or M. I think it does not hurt the player if enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may not hurt the player but it complicates implementation for little reason. I still say remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was gonna remove this myself but then saw other places already support decimal so decided not to bother in the end.
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to pull the latest master
when submitting a PR, and not have it based on a month old commit.
case Operator.Greater: | ||
return Operator.Less; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, the reverse of Greater
is LessOrEqual
. Same goes for the rest.
case Operator.Equal: | ||
return Operator.Equal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very misleading. There is no inverse of the equals operator defined, so this should probably throw. (Also the default
branch doesn't make much sense).
Function could be renamed to reverseInequalityOperator()
to match this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed function as proposed because the previous name was indeed misleading. I also changed the default case to be an out of range exception for unsupported operators.
- removed equality in tests
-changed default case of reverseInequalityOperator() to out of range exception
@Susko3 Sorry, I don' t know when it is best to pull |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested in #25885 (comment), the changes I made in #25885 are now review suggestion diff's in this PR.
Since this is a relatively recurrent feature request and the code was mostly there I've done a pass on it so that we can get it into users' hands. |
Answers #22908.
Adds date criteria for search filter in song select.
Adds corresponding Tests.
InspectCode.ps1 run.
Date criteria is an
OptionalRange<DateTimeOffset>
to be inline with the dates inBeatmapInfo
.tryUpdateDateRange
updates the criteria:dateTimeOffset.Add####
is used to move the criteria in the past starting fromDateTimeOffset.Now
,dateTimeOffset.Add####
would decrease the criteria under 01/01/0001 it is instead set toDateTimeOffset.MinValue +1 ms
,played<30
shows the beatmaps played during the last 30 days so with aBeatmapInfo.LastPlayed > DateTimeOffset.Now - 30 days
) .If a beatmap does not have a
LastPlayed
date it is set toDateTimeOffset.MinValue
in order to always be shown forplayed>##
and always hidden forplayed<##
(as in stable).Notes:
tryUpdateLengthRange
,tryUpdateLengthRange
if deemed useful/needed,BeatmapInfo
to search filter likeLastUpdated
,DateAdded
and so on,played=2015y
shows the beatmaps lastplayed in 2015.