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

This commit is contained in:
lyswhut 2023-08-11 14:17:17 +08:00
parent fc2585eb95
commit 0ab2940347

View File

@ -104,7 +104,10 @@ const getFileMetadata = async(path: string) => {
if (prevFileInfo.path == path) return prevFileInfo.promise
prevFileInfo.path = path
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
})
}
/**