From e0a518fa13be218c1bdf2de50e0c8dd86522b9d4 Mon Sep 17 00:00:00 2001 From: Honey Date: Tue, 28 Apr 2026 09:36:08 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20deduplicate=20NP=20background=20crossfad?= =?UTF-8?q?e=20=E2=80=94=20skip=20if=20URL=20unchanged?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _syncNpDirect is called 2-3x per skip from different call sites; the crossfade now no-ops when the cover URL hasn't changed. 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 6019c1b..b711994 100644 --- a/src/player.js +++ b/src/player.js @@ -58,7 +58,10 @@ export function updatePlayerUI(s) { } let _npBgCurr = 'a'; +let _npBgLastUrl = ''; function _crossfadeNpBg(cv) { + if ((cv || '') === _npBgLastUrl) return; + _npBgLastUrl = cv || ''; const currEl = document.getElementById(`np-bg-${_npBgCurr}`); const nextId = _npBgCurr === 'a' ? 'b' : 'a'; const nextEl = document.getElementById(`np-bg-${nextId}`);