From 41799268997bc72bc17e5cd2449be69fcf610352 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Fri, 22 May 2026 08:34:42 -0700 Subject: [PATCH] Fix missing album placeholder asset path Update Import Music album and queue artwork fallbacks to use the shipped /static/placeholder-album.png asset instead of the nonexistent /static/placeholder.png path. Replace the remaining static UI fallback to the missing placeholder path and add a regression test that fails if static JS references it again. --- tests/webui/test_assets.py | 16 ++++++++++++++++ webui/static/discover.js | 2 +- webui/static/stats-automations.js | 10 +++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/webui/test_assets.py b/tests/webui/test_assets.py index 21660899..8c6a921d 100644 --- a/tests/webui/test_assets.py +++ b/tests/webui/test_assets.py @@ -4,6 +4,7 @@ from __future__ import annotations import json import os +from pathlib import Path import time import pytest @@ -94,3 +95,18 @@ def test_load_webui_vite_manifest_reloads_when_file_changes(tmp_path): second = load_webui_vite_manifest(manifest_path) assert second["src/app/main.tsx"]["file"] == "assets/two.js" + + +def test_static_ui_uses_existing_album_placeholder_asset(): + repo_root = Path(__file__).resolve().parents[2] + static_dir = repo_root / "webui" / "static" + + assert (static_dir / "placeholder-album.png").exists() + assert not (static_dir / "placeholder.png").exists() + + stale_refs = [] + for path in static_dir.glob("*.js"): + if "/static/placeholder.png" in path.read_text(encoding="utf-8"): + stale_refs.append(path.name) + + assert stale_refs == [] diff --git a/webui/static/discover.js b/webui/static/discover.js index e1d05c12..b5303e5d 100644 --- a/webui/static/discover.js +++ b/webui/static/discover.js @@ -6841,7 +6841,7 @@ function _renderByltTrackCard(t) { return `
- ${t.image_url ? `` : '
🎵
'} + ${t.image_url ? `` : '
🎵
'}
${_esc(t.name)}
${_esc(t.artist)}
diff --git a/webui/static/stats-automations.js b/webui/static/stats-automations.js index 100f4a55..6ed96413 100644 --- a/webui/static/stats-automations.js +++ b/webui/static/stats-automations.js @@ -1248,7 +1248,7 @@ function _renderSuggestionCard(a) { id: a.id, name: a.name || '', artist: a.artist || '', source: a.source || '', }; return `
- ${_escAttr(a.name)} + ${_escAttr(a.name)}
${_esc(a.name)}
${_esc(a.artist)}
${a.total_tracks} tracks · ${a.release_date ? a.release_date.substring(0, 4) : ''}
@@ -1282,7 +1282,7 @@ async function importPageSearchAlbum() { }; return `
- ${_escAttr(a.name)} + ${_escAttr(a.name)}
${_esc(a.name)}
${_esc(a.artist)}
${a.total_tracks} tracks · ${a.release_date ? a.release_date.substring(0, 4) : ''}
@@ -1341,7 +1341,7 @@ async function importPageSelectAlbum(albumId) { // Render hero const album = data.album; document.getElementById('import-page-album-hero').innerHTML = ` - ${_escAttr(album.name)} + ${_escAttr(album.name)}
${_esc(album.name)}
${_esc(album.artist)}
@@ -1761,7 +1761,7 @@ async function importPageSearchSingleTrack(fileIdx, query) { const dur = t.duration_ms ? `${Math.floor(t.duration_ms / 60000)}:${String(Math.floor((t.duration_ms % 60000) / 1000)).padStart(2, '0')}` : ''; return `
- ${t.image_url ? `` : ''} + ${t.image_url ? `` : ''}
${_esc(t.name)} - ${_esc(t.artist)}
${_esc(t.album)}${dur ? ' · ' + dur : ''}
@@ -1923,7 +1923,7 @@ function _importQueueRender() { return `
${j.imageUrl - ? `` + ? `` : `
`}
${_esc(j.label)}