-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 support for retrieving submit/rank date from local metadata cache in version 2 #29553
Conversation
… in version 2 Closes ppy#22416.
""" | ||
SELECT `b`.`beatmapset_id`, `b`.`beatmap_id`, `b`.`approved`, `b`.`user_id`, `b`.`checksum`, `b`.`last_update`, `s`.`submit_date`, `s`.`approved_date` | ||
FROM `osu_beatmaps` AS `b` | ||
JOIN `osu_beatmapsets` AS `s` ON `s`.`beatmapset_id` = `b`.`beatmapset_id` | ||
WHERE `b`.`checksum` = @MD5Hash OR `b`.`beatmap_id` = @OnlineID OR `b`.`filename` = @Path | ||
"""; |
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.
Reference for what this is: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/raw-string
Curious of reception.
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 all I've ever wanted. Fixes all the issues with @""
quite well.
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.
One thing I'll point out which is more relevant for server code, is that this still puts lines on a new line. I've been told in the past the reason we use "x" \n + "y"
is because it's sometimes filtered on via proxysql and that makes things easier somehow.
Otherwise I'm all for this syntax.
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.
Yeah, generally when laying out like this I want the newlines in the SQL for logging purposes too. So this would always be something I consider during review.
Code looks sane enough. @bdach did you do something silly like create a local |
Here's one to test with from my local osu-web env: online.zip Recommend testing with something like https://osu.ppy.sh/beatmapsets/386151. |
Checks out. I'll deploy a new database later today. |
…cache People keep asking why ppy#29553 didn't fix their databases (as stated in the PR, it didn't intend to), so this should do it for them.
As is this will not retroactively fix beatmaps where this is missing, although in theory I could write a background processing job that does it using this code. Will do on request, I suppose.
Compatibility matrix:
Footnotes
Lookups using the local metadata will succeed, but submit and rank date will not be populated. ↩ ↩2
Lookups using the local metadata will succeed despite the schema changes to
online.db
, because they happen to be backwards-compatible; the columns removed in https://github.com/ppy/osu-onlinedb-generator/commit/da5a35b419c83ee681e97b2132c5f57cc1d32fc9 were not used. ↩Lookups using the local metadata will succeed, and contain submit and rank date. ↩