« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static
diff options
context:
space:
mode:
Diffstat (limited to 'src/static')
-rw-r--r--src/static/js/client.js32
1 files changed, 4 insertions, 28 deletions
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) {