解决 BGM 文件夹存在非 mp3 文件时报错问题

This commit is contained in:
YILS
2025-10-22 22:09:30 +08:00
parent 7097a95d78
commit 42c94a56f8

View File

@@ -66,9 +66,9 @@ const handleRenderVideo = async () => {
let randomBgm: ListFilesFromFolderRecord | undefined = undefined
if (appStore.renderConfig.bgmPath) {
try {
const bgmList = await window.electron.listFilesFromFolder({
const bgmList = (await window.electron.listFilesFromFolder({
folderPath: appStore.renderConfig.bgmPath.replace(/\\/g, '/'),
})
})).filter((asset) => asset.name.endsWith('.mp3'))
if (bgmList.length > 0) {
randomBgm = random.choice(bgmList)
}