From 20557f2fb82b7f5173a167e578385836d915b0b0 Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 24 Jul 2026 12:24:12 -0400 Subject: [PATCH] fix(ui): serve the placeholder for known-absent art instead of a broken icon getCoverArtUrl returned '' for an imageAbsent record, so rendered as the browser's broken-image icon on every absent cover. The server already serves a proper placeholder for absent art, so build the url and let it render. --- ui/src/subsonic/index.js | 4 ---- ui/src/subsonic/index.test.js | 17 +++++++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ui/src/subsonic/index.js b/ui/src/subsonic/index.js index d0aab8534..9f0ad28d7 100644 --- a/ui/src/subsonic/index.js +++ b/ui/src/subsonic/index.js @@ -81,10 +81,6 @@ const getAvatarUrl = (username, size) => ) const getCoverArtUrl = (record, size, square) => { - // Known-absent art would only ever return a placeholder; skip the round trip entirely. - if (record.imageAbsent) { - return '' - } const suffix = record.imageHash ? '_' + record.imageHash : '' const options = { // A hash-suffixed url is already pixel-versioned; the buster would defeat immutable caching. diff --git a/ui/src/subsonic/index.test.js b/ui/src/subsonic/index.test.js index 27fbd0c2c..32c699a41 100644 --- a/ui/src/subsonic/index.test.js +++ b/ui/src/subsonic/index.test.js @@ -151,14 +151,15 @@ describe('getCoverArtUrl', () => { expect(url).toContain('_=') }) - it('returns an empty url for known-absent artwork', () => { - expect( - subsonic.getCoverArtUrl({ - id: 'album-123', - albumArtist: 'AA', - imageAbsent: true, - }), - ).toBe('') + it('still builds a url for known-absent artwork so the server placeholder renders', () => { + // Returning '' here made render as a broken icon; the server serves a + // proper placeholder for absent art, so the client must still request it. + const url = subsonic.getCoverArtUrl({ + id: 'album-123', + albumArtist: 'AA', + imageAbsent: true, + }) + expect(url).toContain('al-album-123') }) })