-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support filtering for multiple statuses when searching beatmaps in the map picker #27635
Support filtering for multiple statuses when searching beatmaps in the map picker #27635
Conversation
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.
We don't really use the "conventional commits" commit message... convention here. Not sure I'd bother.
Will apply the feedback possibly later today, thanks! (and also add in tests to the As for conventional commits... I'm just too used to using them daily 😅, but if need be I can reword the commits! |
No need for that, they can stay. |
I've applied the requested changes, but I'd love some feedback on how to handle the addition of the values to the set. I don't really like the way I did it but I also dunno if there's a better way (as I'm quite rusty in C#). Also, not fully sure it SortedSet is the ideal struct for this.. 😅 |
So I pushed in some further commits to resolve minor stylistic nits but in general I've got a bit of a doubt as to whether we want this in this form. The reason that makes me question this a bit is that when you specify a compound I dunno if we want this. It's different to stable and kinda different to every single other filter. @ppy/team-client this is very not important but this change is basically good to go otherwise so if you can help with a quick yes/no then we can just check this off the review list for good in either direction... |
Going off the video in the OP alone, my expectation would be for it to be an intersection. I was wondering whether it would be possible to create a keyword in-between two filter expressions to make it into a union. For example: Not sure how complex this would be though - this PR adds support for one expression in a very isolated way. |
Given current structure it's likely a completely different PR that supersedes this one entirely and allows arbitrary compound boolean expression. I dunno about complexity, it's probably going to be not-trivial at least. I was considering different operators but I couldn't figure a good one to use. Maybe we can do something like |
Commas within a single key-value pair should be fine yeah. It's the merging of multiple |
Should I then refactor this to support |
I guess that's the consensus yes.
Filter should fail to parse. Comma-delimited values should only be supported on equality queries. |
Gotcha gotcha, will look into it today! One last question then...what should happen when someone does |
Intersection please. |
And I assume
|
This should ideally match nothing, but that might be annoying, so fine to let the last filter win if needed.
Correct, nothing would be the goal.
Between ranked and loved, both ends exclusive. But yes. Rest seems fine. |
I've pushed the requested changes, and added test cases for most queries. Hopefully I didn't miss anything obvious (outside of maybe code style) |
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
…ers rather than union
eb41f74
to
56dc6bb
Compare
I'm gonna be honest, I really didn't like shoehorning the |
Yeah, checking the code I agree, its definitely better than before, thanks! It also helps me learn more about c# and such 🙏💙 |
This PR adds in the ability to filter by multiple statuses when searching for beatmaps
(I'll be honest, I've only done this because I wanted to be able to do
status=r status=l
when playing osu, as there are some awesome loved maps I'd want to try to play :D)osu.-.2024-03-16.at.21.35.13.mp4
Discussion: should this parse the status input instead, meaning support
status=ranked,loved
? I was going to try to implement it that way but it felt too obscure and complex (also unintuitive to me)