Skip to content

Commit 02d32ff

Browse files
committed
fix: 导出文件夹命名
1 parent e3c2730 commit 02d32ff

File tree

1 file changed

+5
-1
lines changed
  • MaiChartManager/Front/src/components/MusicList/BatchActionButton

1 file changed

+5
-1
lines changed

MaiChartManager/Front/src/components/MusicList/BatchActionButton/remoteExport.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default async (setStep: (step: STEP) => void, musicList: MusicXmlWithABJa
6161
}
6262
let filename = entry.filename;
6363
if (action === OPTIONS.ConvertToMaidata || action === OPTIONS.ConvertToMaidataIgnoreVideo) {
64-
filename = `${music.name}/${filename}`;
64+
filename = `${sanitizeFilename(music.name!)}${music.id! > 1e4 && music.id! < 2e4 ? ' [DX]' : ''}/${filename}`;
6565
}
6666
const fileHandle = await getSubDirFile(folderHandle, filename);
6767
const writable = await fileHandle.createWritable();
@@ -78,3 +78,7 @@ export default async (setStep: (step: STEP) => void, musicList: MusicXmlWithABJa
7878

7979
setStep(STEP.None);
8080
}
81+
82+
const sanitizeFilename = (filename: string) => {
83+
return filename.replace(/[\/:*?"<>|]/g, '_');
84+
}

0 commit comments

Comments
 (0)