From fd6af2e75655ff5366578be90adbef449e344cce Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 13 Dec 2021 20:03:20 +0000 Subject: [PATCH] Improve formatChart for bms --- common/src/utils/util.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/src/utils/util.ts b/common/src/utils/util.ts index c612471d0..7d5c1ed07 100644 --- a/common/src/utils/util.ts +++ b/common/src/utils/util.ts @@ -62,7 +62,13 @@ export function FormatChart( chart: ChartDocument ): string { if (game === "bms") { - return song.title; + const tables = (chart as ChartDocument<"bms:7K" | "bms:14K">).data.tableFolders; + + if (tables.length === 0) { + return song.title; + } + + return `${song.title} (${tables.map((e) => `${e.table}${e.level}`).join(", ")})`; } const gameConfig = GetGameConfig(game);