이지선다: 퀴즈를 아직 안 고른 방이 서버 노래 DB 곡 수(906곡·30문제)를 보이던 것 — 이지선다는 퀴즈 곡만 세어 0곡으로 보임
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,9 @@ test('quiz kinds: picking an 이지선다 퀴즈 makes the room 이지선다; an
|
|||||||
const { cls } = await room(sa, []);
|
const { cls } = await room(sa, []);
|
||||||
const host = cls[0]!;
|
const host = cls[0]!;
|
||||||
host.send({ t: 'config', patch: { mode: 'duel' } });
|
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' });
|
host.send({ t: 'start' });
|
||||||
await host.waitFor((m) => m.t === 'error' && m.message.includes('이지선다 퀴즈를 골라'));
|
await host.waitFor((m) => m.t === 'error' && m.message.includes('이지선다 퀴즈를 골라'));
|
||||||
host.send({ t: 'config', patch: { quizId: duelId } });
|
host.send({ t: 'config', patch: { quizId: duelId } });
|
||||||
|
|||||||
@@ -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)')
|
.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;
|
.get(this.config.quizId, this.config.mode === 'duel' ? 1 : 0)!.n;
|
||||||
this.pool = { playable: n, total: 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 제작된 퀴즈. */
|
/** A question's song: a DB song, or an item of the room's 제작된 퀴즈. */
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ export default function RoomPage() {
|
|||||||
<section className="pool-banner" aria-live="polite">
|
<section className="pool-banner" aria-live="polite">
|
||||||
<div className="grow">
|
<div className="grow">
|
||||||
<h2>
|
<h2>
|
||||||
{c.quizId ? '퀴즈 곡' : '조건에 맞는 곡'} <span className="mono">{room.pool.playable.toLocaleString()}</span>곡
|
{c.quizId || duel ? '퀴즈 곡' : '조건에 맞는 곡'} <span className="mono">{room.pool.playable.toLocaleString()}</span>곡
|
||||||
</h2>
|
</h2>
|
||||||
<p className="small">{configSummary(c, genreName).join(' · ')} · {c.quizId || questions ? `${questions}문제` : '무제한'}</p>
|
<p className="small">{configSummary(c, genreName).join(' · ')} · {c.quizId || questions ? `${questions}문제` : '무제한'}</p>
|
||||||
{room.pool.total > room.pool.playable && (
|
{room.pool.total > room.pool.playable && (
|
||||||
|
|||||||
Reference in New Issue
Block a user