« get me outta code hell

search, client: art tag results - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-01 20:08:16 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-01 20:08:16 -0300
commitf704e76e8632071154a955ae17a0f5dee78a6b12 (patch)
tree814d8b339caae5e371a04479d00a12c8b606de70 /src
parent2660bbcc3b5364cd8e495ce17754ca7edef7f5d1 (diff)
search, client: art tag results
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateSearchSidebarBox.js3
-rw-r--r--src/static/js/client.js15
-rw-r--r--src/strings-default.yaml1
-rw-r--r--src/util/search-spec.js3
4 files changed, 22 insertions, 0 deletions
diff --git a/src/content/dependencies/generateSearchSidebarBox.js b/src/content/dependencies/generateSearchSidebarBox.js
index df11c5d9..6607c789 100644
--- a/src/content/dependencies/generateSearchSidebarBox.js
+++ b/src/content/dependencies/generateSearchSidebarBox.js
@@ -49,6 +49,9 @@ export default {
 
         html.tag('template', {class: 'wiki-search-group-result-kind-string'},
           language.$('misc.search.resultKind.group')),
+
+        html.tag('template', {class: 'wiki-search-tag-result-kind-string'},
+          language.$('misc.search.resultKind.artTag')),
       ],
     }),
 };
diff --git a/src/static/js/client.js b/src/static/js/client.js
index b7b19d7f..733e4586 100644
--- a/src/static/js/client.js
+++ b/src/static/js/client.js
@@ -277,6 +277,7 @@ const getLinkHref = (type, directory) => rebase(`${type}/${directory}`);
 */
 
 const openAlbum = d => rebase(`album/${d}`);
+const openArtTag = d => rebase(`tag/${d}`);
 const openArtist = d => rebase(`artist/${d}`);
 const openFlash = d => rebase(`flash/${d}`);
 const openGroup = d => rebase(`group/${d}`);
@@ -3789,6 +3790,7 @@ const sidebarSearchInfo = initInfo('sidebarSearchInfo', {
   albumResultKindString: null,
   artistResultKindString: null,
   groupResultKindString: null,
+  tagResultKindString: null,
 
   state: {
     sidebarColumnShownForSearch: null,
@@ -3884,6 +3886,9 @@ function getSidebarSearchReferences() {
 
   info.groupResultKindString =
     findString('group-result-kind');
+
+  info.tagResultKindString =
+    findString('art-tag-result-kind');
 }
 
 function addSidebarSearchInternalListeners() {
@@ -4397,6 +4402,16 @@ function generateSidebarSearchResult(result) {
       break;
     }
 
+    case 'tag': {
+      preparedSlots.href =
+        openArtTag(result.directory);
+
+      preparedSlots.kindString =
+        info.tagResultKindString;
+
+      break;
+    }
+
     case 'track': {
       preparedSlots.href =
         openTrack(result.directory);
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index ec09ad70..3fc1d2e9 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -644,6 +644,7 @@ misc:
 
     resultKind:
       album: "(album)"
+      artTag: "(art tag)"
       artist: "(artist)"
       group: "(group)"
 
diff --git a/src/util/search-spec.js b/src/util/search-spec.js
index 4d07019b..22ce71a3 100644
--- a/src/util/search-spec.js
+++ b/src/util/search-spec.js
@@ -89,6 +89,7 @@ export const searchSpec = {
   generic: {
     query: ({
       albumData,
+      artTagData,
       artistData,
       flashData,
       groupData,
@@ -96,6 +97,8 @@ export const searchSpec = {
     }) => [
       albumData,
 
+      artTagData,
+
       artistData
         .filter(artist => !artist.isAlias),