From 1e142d96443deee76fbf1245c527119da20419c8 Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Tue, 12 May 2026 11:44:30 -0500 Subject: [PATCH] fix(frontend): playlists.js thumbnail path uses API endpoint instead of legacy direct path 2 line substitutions in frontend/js/views/playlists.js: switches /uploads/thumbnails/{filename} -> /api/content/{id}/thumbnail at both the playlist editor render (line 293) and the Add-to-playlist content picker (line 543). Brings playlist view inline with widgets.js, content-library.js, and device-detail.js which already use the API path. Side benefit: thumbnails now go through the workspace-aware permission check in content.js's /api/content/:id/thumbnail handler (checkContentRead) instead of unauthenticated static file serve at /uploads/thumbnails/. Reported by semetra22 in Discord ('All images retrieved via the API display correctly, but in the playlists, the images are fetched directly from /uploads/thumbnails/filename and do not display properly'). --- frontend/js/views/playlists.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/js/views/playlists.js b/frontend/js/views/playlists.js index edbc0e5..db38c18 100644 --- a/frontend/js/views/playlists.js +++ b/frontend/js/views/playlists.js @@ -290,7 +290,7 @@ function renderItems(items) {
${i + 1}
${item.thumbnail_path - ? `` + ? `` : `
${getTypeIcon(item)}
` }
@@ -540,7 +540,7 @@ async function showAddItemModal(playlistId) { const isWidget = activeTab === 'widgets'; const name = item.filename || item.name || t('common.unknown'); const sub = isWidget ? (item.widget_type || t('playlist.item_widget')) : (item.mime_type || ''); - const thumb = item.thumbnail_path ? `/uploads/thumbnails/${esc(item.thumbnail_path.split('/').pop())}` : null; + const thumb = item.thumbnail_path ? `/api/content/${esc(item.id)}/thumbnail` : null; return `