From b4512378ddd137ede3c5c94e1675faeb47259f98 Mon Sep 17 00:00:00 2001 From: zk Date: Sun, 17 May 2026 21:36:39 +0000 Subject: [PATCH] ?? --- .../games/jubeat.profile.test.ts | 26 +++++++++---------- .../src/game-implementations/games/jubeat.ts | 3 ++- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/typescript/server/src/game-implementations/games/jubeat.profile.test.ts b/typescript/server/src/game-implementations/games/jubeat.profile.test.ts index 00ab23635..67e113117 100644 --- a/typescript/server/src/game-implementations/games/jubeat.profile.test.ts +++ b/typescript/server/src/game-implementations/games/jubeat.profile.test.ts @@ -1,4 +1,5 @@ import { + CURRENT_JUBEAT_HOT_VERSION, GetBestJubilityOnSongs, GetPBsForJubility, JUBEAT_IMPL, @@ -7,9 +8,6 @@ import DB from "#services/pg/db"; import { seedUser } from "#test-utils/pg-fixtures"; import { describe, expect, it } from "vitest"; -/** Matches {@link CURRENT_JUBEAT_HOT_VERSION} in `jubeat.ts`. */ -const JUBEAT_HOT_DISPLAY_VERSION = "ave"; - let jubeatSeedCounter = 0; async function seedJubeatSong(args: { displayVersion: string; songID: string }): Promise { @@ -114,7 +112,7 @@ describe("GetBestJubilityOnSongs (Postgres)", () => { await seedJubeatSong({ songID, - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, }); await seedJubeatChartPbOnSong(userId, songID, { difficulty: "HARD BSC", @@ -137,7 +135,7 @@ describe("GetBestJubilityOnSongs (Postgres)", () => { await seedJubeatSong({ songID, - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, }); await seedJubeatChartPbOnSong(userId, songID, { difficulty: "BSC", @@ -164,7 +162,7 @@ describe("GetBestJubilityOnSongs (Postgres)", () => { songIDs.map((songID, i) => seedJubeatSongChartPb(userId, { songID, - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, difficulty: "EXT", jubility: 100 + i, }), @@ -184,7 +182,7 @@ describe("GetBestJubilityOnSongs (Postgres)", () => { await seedJubeatSongChartPb(userId, { songID, - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, difficulty: "NOT_A_REAL_BUCKET", jubility: 9999, }); @@ -205,12 +203,12 @@ describe("GetPBsForJubility (Postgres)", () => { expect(bestScores).toEqual([]); }); - it("places ave songs in pickUp and non-ave songs in other", async () => { + it("places hot-pool songs in pickUp and other versions in other", async () => { const { id: userId } = await seedUser(); await seedJubeatSongChartPb(userId, { songID: "jubeat-prof-song-400200", - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, difficulty: "EXT", jubility: 50, }); @@ -232,7 +230,7 @@ describe("GetPBsForJubility (Postgres)", () => { expect(bestScores[0]!.calculatedData.jubility).toBe(80); }); - it("treats missing displayVersion as cold (IS DISTINCT FROM ave)", async () => { + it("treats missing displayVersion as cold (IS DISTINCT FROM hot pool)", async () => { const { id: userId } = await seedUser(); const n = ++jubeatSeedCounter; const songID = `jubeat-prof-song-${n}`; @@ -301,7 +299,7 @@ describe("JUBEAT_IMPL.profileCalcs (Postgres)", () => { await seedJubeatSongChartPb(userId, { songID: "jubeat-prof-song-400300", - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, difficulty: "EXT", jubility: 100, }); @@ -325,7 +323,7 @@ describe("JUBEAT_IMPL.profileCalcs (Postgres)", () => { Array.from({ length: 3 }, (_, i) => seedJubeatSongChartPb(userId, { songID: `jubeat-prof-song-400400${i}`, - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, difficulty: "EXT", jubility: 10 * (i + 1), }), @@ -342,7 +340,7 @@ describe("JUBEAT_IMPL.profileCalcs (Postgres)", () => { await seedJubeatSongChartPb(userId, { songID: "jubeat-prof-song-400500", - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, difficulty: "EXT", isPrimary: false, jubility: 5000, @@ -362,7 +360,7 @@ describe("JUBEAT_IMPL.profileCalcs (Postgres)", () => { songIDs.map((songID, i) => seedJubeatSongChartPb(userId, { songID, - displayVersion: JUBEAT_HOT_DISPLAY_VERSION, + displayVersion: CURRENT_JUBEAT_HOT_VERSION, difficulty: "EXT", jubility: 1000 + i, }), diff --git a/typescript/server/src/game-implementations/games/jubeat.ts b/typescript/server/src/game-implementations/games/jubeat.ts index 53b9df77c..9806eda59 100644 --- a/typescript/server/src/game-implementations/games/jubeat.ts +++ b/typescript/server/src/game-implementations/games/jubeat.ts @@ -106,7 +106,8 @@ export async function GetBestJubilityOnSongs( return Promise.all(rows.rows.map((row) => ToPbScoreDocument(row))); } -const CURRENT_JUBEAT_HOT_VERSION: Versions["jubeat"] = "beyond"; +/** Songs in this `displayVersion` bucket contribute to the hot jubility pick list. */ +export const CURRENT_JUBEAT_HOT_VERSION: Versions["jubeat"] = "beyond"; export async function GetPBsForJubility(userID: integer) { const hotSongRows = await DB.selectFrom("song")