« get me outta code hell

client, search: disambiguate harder - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/search-select.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-02-12 17:55:47 -0400
committer(quasar) nebula <qznebula@protonmail.com>2026-02-12 17:55:47 -0400
commite82707fadb8a441c9ef8dc2de85a34d53d7c5abe (patch)
tree5143745c9f9332f26f0142fc90177431d2af4341 /src/search-select.js
parentf227fe62e80f4671ed1e260680ae1adf6f80ba75 (diff)
client, search: disambiguate harder
Diffstat (limited to 'src/search-select.js')
-rw-r--r--src/search-select.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/search-select.js b/src/search-select.js
index a7dcf81a..81734140 100644
--- a/src/search-select.js
+++ b/src/search-select.js
@@ -3,7 +3,7 @@
 // These files totally go together, so read them side by side, okay?
 
 import baseSearchSpec from '#search-shape';
-import {unique} from '#sugar';
+import {empty, unique} from '#sugar';
 import {compareKebabCase} from '#wiki-data';
 
 function prepareArtwork(artwork, thing, {
@@ -127,8 +127,8 @@ function baselineProcess(thing, _opts) {
   fields.color =
     thing.color;
 
-  fields.disambiguator =
-    null;
+  fields.disambiguators =
+    [];
 
   return fields;
 }
@@ -209,8 +209,21 @@ function genericProcess(thing, opts) {
         : 'track')
       : null);
 
-  fields.disambiguator =
-    fields.parentName;
+  fields.disambiguators =
+    (thing.isTrack
+      ? [
+          (fields.classification === 'single'
+            ? null
+            : fields.parentName),
+
+          (empty(thing.artistContribs)
+            ? null
+            : thing.artistContribs
+                .map(contrib => contrib.artist.name)
+                .join(', ')),
+        ]
+
+      : [thing.parentName]);
 
   fields.artTags =
     (Array.from(new Set(