fix: deduplicate NP background crossfade — skip if URL unchanged

_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 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-04-28 09:36:08 +02:00
1 parent 97a4cc756d
commit e0a518fa13
1 file changed
+3
+3
View File
@@ -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}`);