From 30c3fab893fb1cb8ffb7229fd68e6bb8af19c8bc Mon Sep 17 00:00:00 2001 From: EJClaw Date: Fri, 23 Oct 2026 21:05:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=84=A0=EB=8B=A4:=20?= =?UTF-8?q?=ED=80=B4=EC=A6=88=EB=A5=BC=20=EC=95=84=EC=A7=81=20=EC=95=88=20?= =?UTF-8?q?=EA=B3=A0=EB=A5=B8=20=EB=B0=A9=EC=9D=B4=20=EC=84=9C=EB=B2=84=20?= =?UTF-8?q?=EB=85=B8=EB=9E=98=20DB=20=EA=B3=A1=20=EC=88=98(906=EA=B3=A1?= =?UTF-8?q?=C2=B730=EB=AC=B8=EC=A0=9C)=EB=A5=BC=20=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EB=8D=98=20=EA=B2=83=20=E2=80=94=20=EC=9D=B4=EC=A7=80=EC=84=A0?= =?UTF-8?q?=EB=8B=A4=EB=8A=94=20=ED=80=B4=EC=A6=88=20=EA=B3=A1=EB=A7=8C=20?= =?UTF-8?q?=EC=84=B8=EC=96=B4=200=EA=B3=A1=EC=9C=BC=EB=A1=9C=20=EB=B3=B4?= =?UTF-8?q?=EC=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- apps/server/src/duel.test.ts | 4 +++- apps/server/src/rooms/manager.ts | 3 ++- apps/web/src/pages/RoomPage.tsx | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/server/src/duel.test.ts b/apps/server/src/duel.test.ts index 1259176..8d7930a 100644 --- a/apps/server/src/duel.test.ts +++ b/apps/server/src/duel.test.ts @@ -69,7 +69,9 @@ test('quiz kinds: picking an 이지선다 퀴즈 makes the room 이지선다; an const { cls } = await room(sa, []); const host = cls[0]!; host.send({ t: 'config', patch: { mode: 'duel' } }); - await host.waitFor((m) => m.t === 'room' && m.room.config.mode === 'duel'); + const none = (await host.waitFor((m) => m.t === 'room' && m.room.config.mode === 'duel')) as Msg<'room'>; + // no 이지선다 퀴즈 yet: no songs (not the server DB pool) + expect(none.room.pool).toEqual({ playable: 0, total: 0 }); host.send({ t: 'start' }); await host.waitFor((m) => m.t === 'error' && m.message.includes('이지선다 퀴즈를 골라')); host.send({ t: 'config', patch: { quizId: duelId } }); diff --git a/apps/server/src/rooms/manager.ts b/apps/server/src/rooms/manager.ts index 2dff2b4..e5a0da2 100644 --- a/apps/server/src/rooms/manager.ts +++ b/apps/server/src/rooms/manager.ts @@ -71,7 +71,8 @@ export class Room { .query<{ n: number }, [number, number]>('SELECT COUNT(*) n FROM custom_quiz_items WHERE quiz_id = ? AND (? = 0 OR views IS NOT NULL)') .get(this.config.quizId, this.config.mode === 'duel' ? 1 : 0)!.n; this.pool = { playable: n, total: n }; - } else this.pool = countPool(this.deps.db, this.config); + } else if (this.config.mode === 'duel') this.pool = { playable: 0, total: 0 }; // 이지선다 plays only an 이지선다 퀴즈 + else this.pool = countPool(this.deps.db, this.config); } /** A question's song: a DB song, or an item of the room's 제작된 퀴즈. */ diff --git a/apps/web/src/pages/RoomPage.tsx b/apps/web/src/pages/RoomPage.tsx index 1791dcd..5860938 100644 --- a/apps/web/src/pages/RoomPage.tsx +++ b/apps/web/src/pages/RoomPage.tsx @@ -186,7 +186,7 @@ export default function RoomPage() {

- {c.quizId ? '퀴즈 곡' : '조건에 맞는 곡'} {room.pool.playable.toLocaleString()}곡 + {c.quizId || duel ? '퀴즈 곡' : '조건에 맞는 곡'} {room.pool.playable.toLocaleString()}곡

{configSummary(c, genreName).join(' · ')} · {c.quizId || questions ? `${questions}문제` : '무제한'}

{room.pool.total > room.pool.playable && (