From 1b399c2451b222597bf734dbf8a211e8b421fe07 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 13 May 2024 09:02:54 -0300 Subject: search, client: refactor & simplify search result image processing --- src/static/js/client.js | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'src/static') diff --git a/src/static/js/client.js b/src/static/js/client.js index 771d2011..bee82938 100644 --- a/src/static/js/client.js +++ b/src/static/js/client.js @@ -3862,36 +3862,12 @@ function generateSidebarSearchResult(result) { function getSearchResultImageSource(result) { const {artwork} = result.data; - if (!artwork) return null; - const [kind, ...opts] = artwork; - - switch (kind) { - case 'flash': - return rebase( - ('flash-art' - + `/${result.directory}.small.jpg`), - 'rebaseThumb'); - - case 'track': - return rebase( - (`album-art` - + `/${opts[0]}` - + `/${result.directory}` - + `.small.jpg`), - 'rebaseThumb'); - - case 'track-album': - return rebase( - (`album-art` - + `/${opts[0]}` - + `/cover.small.jpg`), - 'rebaseThumb'); - - default: - return null; - } + return ( + rebase( + artwork.replace('<>', result.directory), + 'rebaseThumb')); } function generateSidebarSearchResultTemplate(slots) { -- cgit 1.3.0-6-gf8a5