8000 Schema v2: one required song.id per song (backfilled everywhere) by noahm · Pull Request #673 · noahm/DDRCardDraw · GitHub
[go: up one dir, main page]

Skip to content

Schema v2: one required song.id per song (backfilled everywhere) - #673

Merged
noahm merged 4 commits into
mainfrom
song-id
Oct 26, 2026
Merged

noahm merged 4 commits into
mainfrom
song-id

Conversation

@noahm
@noahm noahm commented Oct 20, 2026
Copy link
Copy Markdown
Owner

Summary

Step 3 of the M3 rollout (schema revision), part 2 of 3. Part 1 is RhythmGameTools/rgt-data#5 (hosts v2.json and lets the publish API accept it). This PR moves main's data to v2. main doesn't publish anything, so it doesn't depend on rgt-data#5. But rgt-data#5 must be deployed before this reaches partykit, because partykit's custom-data publishing will start sending v2 bundles.

Schema

  • songs.schema.json is now identical to the hosted data.ddr.tools/schema/v2.json:
    • song.id: required, unique within a file. Replaces saHash and saIndex.
    • The hosted schema's i18n rules come over (en complete, other locales partial).
  • validate.mjs rejects duplicate song ids.

Backfill (every file in src/songs)

Source of id Files
3icecream hash (former saHash) DDR mixes, bite7
other former saHash iidx (textage tag), jubeat, sdvx, donkeykonga
former saIndex pump ×3, smx (573.no song_id), ez2ac, drs (e-amusement id)
SEGA music id, matched by jacket ongeki (919 of 922; separates the 65 LUNATIC re-releases)
iidx.json's textage id, matched by name + artist septa2-iidx (1,731 of 1,762; its saIndex was only a list position)
derived from name + artist (deriveSongId) event sets, maimai, the DDR songs 3icecream doesn't know, the leftovers above
  • DDR's own saIndex (sanbai's numeric index, unused) is dropped.
  • DDR songs without a hash borrow one from another DDR file when that's unambiguous (5 songs).
  • Derived ids are computed once and kept. Being deterministic, the same song gets the same id in every file.
  • ddr_x3 has two different IF YOU WERE HERE songs. The X2 version gets the derived id plus -x2.
  • Duplicates merged: bite7 (22 entries folded into their songs) and maimai's two utage songs (5 entries).
  • Files keep their existing layout: only the id lines change, except bite7 and maimai, which are rewritten. Data lastUpdated values are untouched.

Importers

  • Every importer matches existing songs by id and writes id on new songs.
  • Sources without ids of their own (maimai, ITG packs, DDR GRAND PRIX additions) use deriveSongId, so re-imports keep the backfilled ids.
  • maimai merges utage entries into one song each (mergeSongsById).
  • ongeki matches existing songs by SEGA id instead of title.
  • Re-run checks: re-running import:drs reproduces drs.json exactly, apart from lastUpdated. Re-running import:ongeki kept all 919 ids, and new songs got SEGA ids. Both results were discarded, not committed.
  • scripts/utils.mts gains deriveSongId, isSanbaiId and mergeSongsById.

App

  • Share CSV: the 3icecream link now recognizes 3icecream ids by their alphabet (01689DIOPQbdiloq), since DRS ids are also 32 characters.
  • Song search: result keys use song.id.
  • Dropped ITG packs: each song's folder name is its id.

Heads-up

  • Chart identity on partykit: partykit builds chart keys from saHash || name|artist. The follow-up partykit PR switches those keys to song.id and keeps recognizing old keys already stored in rooms. Songs whose id was already their saHash keep the same keys. main doesn't build chart keys, so nothing changes here.
  • Script typecheck: tsc -p scripts reports the same pre-existing errors as main, and no new ones.

Test plan

  • yarn validate (data + schema codegen, tsc, oxfmt, oxlint)
  • DRS importer re-run produces no data change; ongeki re-run preserves ids
  • Spot-check draws, song search and the share CSV for a DDR set and DRS in a dev build

🤖 Generated with Claude Code

noahm and others added 2 commits October 20, 2026 10:07
songs.schema.json now matches the hosted data.ddr.tools/schema/v2.json:
song.id (required, unique within a file) replaces saHash and saIndex,
and the hosted schema's i18n rules come over. validate.mjs rejects
duplicate song ids.

Every catalog is backfilled:
- the source's own id where there is one: 3icecream hash (DDR), textage
  tag (IIDX), jubeat/SDVX/Donkey Konga ids, Pump/SMX/EZ2AC/DRS ids, and
  SEGA's music id for ongeki (matched by jacket)
- septa2-iidx's saIndex was only a list position, so its songs take
  iidx.json's textage ids instead
- DDR songs missing a hash borrow one from another DDR file when that's
  unambiguous; DDR's own saIndex (unused) is dropped
- everything else gets an id derived from name + artist, so the same
  song lines up across files; ddr_x3's X2 IF YOU WERE HERE gets "-x2"
- songs listed more than once are merged: bite7 (22 entries) and
  maimai's utage songs (5)

Files keep their existing layout; only the id lines change, apart from
bite7 and maimai, which are rewritten.

The 3icecream share link now recognizes 3icecream ids by their
alphabet, since DRS ids are also 32 characters long. Dropped ITG packs
use each song's folder name as its id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Importers match existing songs by `id` and write it on new ones, in
place of saHash/saIndex. Sources without ids of their own (maimai, ITG
packs, DDR GRAND PRIX additions) use deriveSongId(name, artist), so
re-imports keep the ids the backfill gave them. maimai's utage entries
are merged into one song each (mergeSongsById), and ongeki now matches
existing songs by SEGA id rather than title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel
vercel Bot commented Oct 20, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ddr-tools Ready Ready Preview Oct 26, 2026 2:41pm UTC

ddr_world.json and ddr_grand_prix.json are taken from main and given
their song ids the same way as the original backfill. Every song kept
its id; the two new DDR WORLD songs (Good Life, One Kiss) take their
3icecream ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/songs/dia_del_ritmo_26.json
@noahm
noahm merged commit 283ff44 into main Oct 26, 2026
7 checks passed
@noahm
noahm deleted the song-id branch October 26, 2026 14:43

This branch was successfully deployed

1 active deployment
Preview — ee30bd94 Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0