From c037ee623d5b6975ad22222f8cd55bfce5603568 Mon Sep 17 00:00:00 2001 From: Honey Date: Thu, 14 May 2026 19:49:57 +0200 Subject: [PATCH] fix: preload hi-res NP cover on track change so overlay opens instantly _crossfadeNpBg only preloaded the 1024px cover when the NP overlay was already open. Opening it fresh showed the old cover for ~0.5s while the new image downloaded. Preloading in updatePlayerUI caches it immediately. Co-Authored-By: Claude Sonnet 4.6 --- src/player.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/player.js b/src/player.js index 05bcd60..0ecd8ca 100644 --- a/src/player.js +++ b/src/player.js @@ -381,6 +381,9 @@ export function updatePlayerUI(s, _skipMediaSession = false) { })); } catch {} _syncNpDirect(s); + // Preload the hi-res NP cover now so opening the overlay is instant + const _npCv = coverUrl(s.coverArt, 1024); + if (_npCv && _npCv !== _npBgLastUrl) { const _pre = new Image(); _pre.src = _npCv; } } let _npBgCurr = 'a';