Fix: Support both numeric and hash song IDs for leaderboard

This commit is contained in:
2026-01-17 19:56:41 +08:00
parent 3f7ff13ef7
commit 9935d70e31
5 changed files with 20 additions and 15 deletions

View File

@@ -958,11 +958,12 @@ class Scoresheet {
}
submitToLeaderboard(songId, difficulty, scoreObj) {
// Only submit if user is logged in and song has valid numeric ID
if (!account.loggedIn || !songId || isNaN(parseInt(songId))) {
// Only submit if user is logged in and song has an ID
if (!account.loggedIn || !songId) {
return
}
var self = this
loader.getCsrfToken().then(token => {
var request = new XMLHttpRequest()
@@ -984,7 +985,7 @@ class Scoresheet {
}
request.send(JSON.stringify({
song_id: parseInt(songId),
song_id: songId,
difficulty: difficulty,
score: scoreObj
}))