From e7ab29b7e80f628c10e8c2c3a49cb420ae2fa064 Mon Sep 17 00:00:00 2001 From: Starrah Date: Mon, 2 Feb 2026 12:31:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#34:=20ID=E5=86=B2=E7=AA=81=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E8=A6=81=E6=8A=8A=E5=8E=9F=E6=9C=89=E7=9A=84=E6=AD=8C?= =?UTF-8?q?=E6=9B=B2=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImportChartButton/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MaiChartManager/Front/src/components/ImportCreateChartButton/ImportChartButton/index.tsx b/MaiChartManager/Front/src/components/ImportCreateChartButton/ImportChartButton/index.tsx index 67d01a6d..537291d0 100644 --- a/MaiChartManager/Front/src/components/ImportCreateChartButton/ImportChartButton/index.tsx +++ b/MaiChartManager/Front/src/components/ImportCreateChartButton/ImportChartButton/index.tsx @@ -211,9 +211,13 @@ export default defineComponent({ } }) errors.value.push({ level: MessageLevel.Fatal, message: e.error?.message || e.error?.detail || e.message || e.toString(), name: music.name }); - try { - await api.DeleteMusic(music.id, selectedADir.value); - } catch { + if (music.importStep !== IMPORT_STEP.create) { + // 如果是在创建乐曲这步就挂了,说明乐曲XML没有创建成功,则不需要删除乐曲。 + // 否则,在ID冲突的情况下,会把原本的乐曲给删除掉,见 https://github.com/MuNET-OSS/MaiChartManager/issues/34 + try { + await api.DeleteMusic(music.id, selectedADir.value); + } catch { + } } } }