Skip to content

feat: use chart ids and level hashes from the level-hash backend - #79

Merged
LeZi9916 merged 2 commits into
mainfrom
feat/level-hash
Nov 8, 2026
Merged

LeZi9916 merged 2 commits into
mainfrom
feat/level-hash

Conversation

@sparkbarry

Copy link
Copy Markdown
Member

配合 TeamMajdata/mmfcapi#44:后端成绩按 level hash 存储,互动、投票、评论和歌单按谱面 Id 存储。需要与后端 TeamMajdata/mmfcapi#47 一起上线:先迁移数据并部署后端,再部署前端。

改动

  • 成绩卡排名改用 GET /api/maiscore/leaderboard/chart/by-level/{levelHash},成绩没有 level hash 时退回按谱面查询。
  • 单曲排行榜读取新的响应 { hash, levelHashes, scores }。
  • 季赛榜及单曲明细的请求体用 songIds(谱面 Id)代替 songHashes。
  • 歌单增删曲目改用 chartIdsToAdd / chartIdsToRemove,保存歌单时 items 为谱面 Id,歌单页不再为取 hash 请求 summary。
  • api-directory.md 记录接口变化,并新增单元测试。

测试

  • npm test:32 个文件、230 个测试全部通过;tsc -b 和 i18n 检查通过。
  • 本地连接新后端测试过页面。季赛榜界面因测试数据里没有活动,未实际验证。

sparkbarry and others added 2 commits November 7, 2026 10:59
Follows TeamMajdata/mmfcapi#44, where scores are stored per level hash and
interactions, votes, comments and collections are keyed by chart id.

- Score cards rank by GET api/maiscore/leaderboard/chart/by-level/{levelHash}
  and fall back to the chart leaderboard when a score has no level hash.
- The chart leaderboard reads the { hash, levelHashes, scores } response.
- The season leaderboard and its per-chart breakdown send songIds (chart ids)
  instead of songHashes.
- Collections add and remove charts with chartIdsToAdd/chartIdsToRemove and
  save items as chart ids, so the collection page no longer fetches summaries
  for hashes.
- Document the API changes in api-directory.md and add unit tests.

@LeZi9916 LeZi9916 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@LeZi9916
LeZi9916 merged commit bf6d4fd into main Nov 8, 2026
2 checks passed
@LeZi9916
LeZi9916 deleted the feat/level-hash branch November 8, 2026 07:35
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.

2 participants