修复图片更新问题

This commit is contained in:
lyswhut 2023-03-16 18:46:20 +08:00
parent 713eccdca3
commit 3f08e7a7c7
2 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ export const getPicUrl = async({ musicInfo, listId, isRefresh, onToggleSource =
if (!otherSource.length) throw new Error('source not found') if (!otherSource.length) throw new Error('source not found')
return await getOnlineOtherSourcePicUrl({ musicInfos: [...otherSource], onToggleSource, isRefresh }).then(({ url, musicInfo: targetMusicInfo, isFromCache }) => { return await getOnlineOtherSourcePicUrl({ musicInfos: [...otherSource], onToggleSource, isRefresh }).then(({ url, musicInfo: targetMusicInfo, isFromCache }) => {
if (listId) { if (listId) {
// musicInfo.meta.picUrl = url musicInfo.meta.picUrl = url
void updateListMusics([{ id: listId, musicInfo }]) void updateListMusics([{ id: listId, musicInfo }])
} }

View File

@ -52,7 +52,7 @@ export const getMusicUrl = async({ musicInfo, quality, isRefresh, allowToggleSou
// // return Promise.reject(new Error('该歌曲没有可播放的音频')) // // return Promise.reject(new Error('该歌曲没有可播放的音频'))
// } // }
const targetQuality = quality ?? getPlayQuality(settingState.setting['player.highQuality'], musicInfo) const targetQuality = quality ?? getPlayQuality(settingState.setting['player.isPlayHighQuality'], musicInfo)
const cachedUrl = await getStoreMusicUrl(musicInfo, targetQuality) const cachedUrl = await getStoreMusicUrl(musicInfo, targetQuality)
if (cachedUrl && !isRefresh) return cachedUrl if (cachedUrl && !isRefresh) return cachedUrl
@ -74,7 +74,7 @@ export const getPicUrl = async({ musicInfo, listId, isRefresh, allowToggleSource
return await handleGetOnlinePicUrl({ musicInfo, onToggleSource, isRefresh, allowToggleSource }).then(({ url, musicInfo: targetMusicInfo, isFromCache }) => { return await handleGetOnlinePicUrl({ musicInfo, onToggleSource, isRefresh, allowToggleSource }).then(({ url, musicInfo: targetMusicInfo, isFromCache }) => {
// picRequest = null // picRequest = null
if (listId) { if (listId) {
// musicInfo.meta.picUrl = url musicInfo.meta.picUrl = url
void updateListMusics([{ id: listId, musicInfo }]) void updateListMusics([{ id: listId, musicInfo }])
} }
// savePic({ musicInfo, url, listId }) // savePic({ musicInfo, url, listId })