From d5aa7468683d5cf6d509824dc5526517b4e94b0c Mon Sep 17 00:00:00 2001 From: nairobi <61069237+nyairobi@users.noreply.github.com> Date: Mon, 8 Jun 2026 20:22:34 +0200 Subject: [PATCH] fix: remove level from FormatDifficultySearch (#1652) * fix: remove level from FormatDifficultySearch * nullable for a reason --- typescript/common/src/utils/util.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/typescript/common/src/utils/util.ts b/typescript/common/src/utils/util.ts index a5a706c32..fca513b89 100644 --- a/typescript/common/src/utils/util.ts +++ b/typescript/common/src/utils/util.ts @@ -108,7 +108,22 @@ function FormatDifficultyInternal(chart: ChartDocument, short: boolean): string * Formats a chart's difficulty for searching, such as forwarding this query to youtube. */ export function FormatDifficultySearch(chart: ChartDocument): string | null { - return FormatDifficultyLong(chart); + const gameGroup = GameToGameGroup(chart.game); + const gameConfig = GetGameConfig(chart.game); + + if (["bms", "itg", "pms"].includes(gameGroup)) { + return null; + } + + let diff: string | undefined; + if ( + gameConfig.difficulties.type === "FIXED" || + gameConfig.difficulties.type === "CHUGEKIMAI_STYLE" + ) { + diff = gameConfig.difficulties.formatLong[chart.difficulty]; + } + diff ??= chart.difficulty; + return diff.trim(); } export function FormatGame(game: V3Game): string {