修复本地文件解析异常时的错误处理问题

pull/1583/head
lyswhut 2023-08-11 14:17:17 +08:00
parent fc2585eb95
commit 0ab2940347
1 changed files with 4 additions and 1 deletions

View File

@ -104,7 +104,10 @@ const getFileMetadata = async(path: string) => {
if (prevFileInfo.path == path) return prevFileInfo.promise if (prevFileInfo.path == path) return prevFileInfo.promise
prevFileInfo.path = path prevFileInfo.path = path
return prevFileInfo.promise = checkPath(path).then(async(isExist) => { return prevFileInfo.promise = checkPath(path).then(async(isExist) => {
return isExist ? import('music-metadata').then(async({ parseFile }) => parseFile(path)) : null return isExist ? import('music-metadata').then(async({ parseFile }) => parseFile(path)).catch(err => {
console.log(err)
return null
}) : null
}) })
} }
/** /**