修改图片读取顺序

pull/1050/head
lyswhut 2022-10-29 13:19:15 +08:00
parent 8841951fe3
commit 3e9a111643
2 changed files with 5 additions and 5 deletions

View File

@ -28,14 +28,14 @@ export const getPicUrl = async({ musicInfo, isRefresh, listId, onToggleSource =
onToggleSource?: (musicInfo?: LX.Music.MusicInfoOnline) => void
}): Promise<string> => {
if (!isRefresh) {
const onlineMusicInfo = musicInfo.metadata.musicInfo
if (onlineMusicInfo.meta.picUrl && !isRefresh) return onlineMusicInfo.meta.picUrl
const path = await getDownloadFilePath(musicInfo, appSetting['download.savePath'])
if (path) {
const pic = await window.lx.worker.main.getMusicFilePic(path)
if (pic) return pic
}
const onlineMusicInfo = musicInfo.metadata.musicInfo
if (onlineMusicInfo.meta.picUrl) return onlineMusicInfo.meta.picUrl
}
return await getOnlinePicUrl({ musicInfo: musicInfo.metadata.musicInfo, isRefresh, onToggleSource }).then((url) => {

View File

@ -40,10 +40,10 @@ export const getPicUrl = async({ musicInfo, listId, isRefresh, onToggleSource =
onToggleSource?: (musicInfo?: LX.Music.MusicInfoOnline) => void
}): Promise<string> => {
if (!isRefresh) {
if (musicInfo.meta.picUrl) return musicInfo.meta.picUrl
const pic = await window.lx.worker.main.getMusicFilePic(musicInfo.meta.filePath)
if (pic) return pic
if (musicInfo.meta.picUrl) return musicInfo.meta.picUrl
}
onToggleSource()