修改图片读取顺序
parent
8841951fe3
commit
3e9a111643
|
@ -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) => {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue