diff --git a/src/player/player.js b/src/player/player.js index 04550ba..bff1412 100644 --- a/src/player/player.js +++ b/src/player/player.js @@ -527,9 +527,15 @@ export function updatePlayerUI(s, _skipMediaSession = false) { } catch {} _syncNpDirect(s); _updatePlayingHighlights(); - // Preload the hi-res NP cover now so opening the overlay is instant + // Keep the NP cover element pointing at the CURRENT song even while the overlay is closed, + // so opening it after rapid skips never shows a stale cover (it also preloads in the background). const _npCv = coverUrl(s.coverArt, 1024); - if (_npCv && _npCv !== _npBgLastUrl) { const _pre = new Image(); _pre.src = _npCv; } + const _npCover = document.getElementById('np-cover'); + const _npImg = _npCover?.querySelector('img'); + if (_npCv) { + if (_npImg) { if (_npImg.src !== _npCv) _npImg.src = _npCv; } + else if (_npCover) _npCover.innerHTML = ``; + } // Pre-warm the next song's 1024 cover so auto-advance NP swap is instant from cache const _nextForPreload = S.qIdx + 1 < S.queue.length ? S.queue[S.qIdx + 1] : null; if (_nextForPreload?.coverArt) {