From 3bfe0623b374e553b04e8d18a7771832b7035b6f Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 24 Jan 2024 18:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/player/playList.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/player/playList.ts b/src/plugins/player/playList.ts index 29a5377..1364ca4 100644 --- a/src/plugins/player/playList.ts +++ b/src/plugins/player/playList.ts @@ -174,7 +174,7 @@ export const playMusic = (musicInfo: LX.Player.PlayMusic, url: string, time: num // let musicId = null // let duration = 0 -// let artwork = null +let prevArtwork: string | undefined const updateMetaInfo = async(mInfo: LX.Player.MusicInfo) => { const isShowNotificationImage = settingState.setting['player.isShowNotificationImage'] // const mInfo = formatMusicInfo(musicInfo) @@ -190,11 +190,13 @@ const updateMetaInfo = async(mInfo: LX.Player.MusicInfo) => { // } // console.log('+++++updateMetaInfo+++++', mInfo.name) isPlaying = await TrackPlayer.getState() == State.Playing + let artwork = isShowNotificationImage ? mInfo.pic ?? prevArtwork : undefined + if (mInfo.pic) prevArtwork = mInfo.pic await TrackPlayer.updateNowPlayingMetadata({ title: mInfo.name ?? 'Unknow', artist: mInfo.singer ?? 'Unknow', album: mInfo.album ?? undefined, - artwork: isShowNotificationImage ? mInfo.pic ?? undefined : undefined, + artwork, duration: prevDuration || 0, }, isPlaying) }