parse logic improvement for adding maps into mappool

This commit is contained in:
2026-03-07 03:32:44 +01:00
parent 43692ae4e9
commit 1ea528249a

View File

@@ -126,8 +126,10 @@ export const actions: Actions = {
const urlMatch = beatmapId.match(/beatmaps\/(\d+)/);
const setMatch = beatmapId.match(/beatmapsets\/\d+#\w+\/(\d+)/);
const shortMatch = beatmapId.match(/\/b\/(\d+)/);
if (urlMatch) beatmapId = urlMatch[1];
else if (setMatch) beatmapId = setMatch[1];
else if (shortMatch) beatmapId = shortMatch[1];
if (!/^\d+$/.test(beatmapId)) {
return { error: 'Invalid beatmap ID' };