pull/1050/head
lyswhut 2022-11-04 19:17:13 +08:00
parent 9eaf072e8f
commit 209bf9e0aa
1 changed files with 4 additions and 4 deletions

View File

@ -52,10 +52,10 @@ export const getList = async(source: Source): Promise<string[]> => {
task.push(
sourceList[source]?.length
? Promise.resolve({ source, list: sourceList[source] })
: music[source]?.hotSearch.getList().catch((err: any) => {
: (music[source]?.hotSearch.getList() ?? Promise.reject(new Error('source not found: ' + source))).catch((err: any) => {
console.log(err)
return { source, list: [] }
}) ?? Promise.reject(new Error('source not found: ' + source)),
}),
)
}
return Promise.all(task).then((results: any[]) => {