« get me outta code hell

data, yaml: basic who/what -> artist/annotation - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/yaml.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-24 11:14:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-01 07:06:04 -0300
commita6e2493f13636f8586fd177dd493812bbcb09dbd (patch)
treeab768b6141db5ed40626f9427b378ac03a1cf299 /src/data/yaml.js
parent06fd68f0305c11d450f2c97fddac88056b8bfc6b (diff)
data, yaml: basic who/what -> artist/annotation
Diffstat (limited to 'src/data/yaml.js')
-rw-r--r--src/data/yaml.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 86f30143..5026a97e 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -393,7 +393,16 @@ export function parseContributors(contributionStrings) {
 
   return contributionStrings.map(item => {
     if (typeof item === 'object' && item['Who'])
-      return {who: item['Who'], what: item['What'] ?? null};
+      return {
+        artist: item['Who'],
+        annotation: item['What'] ?? null,
+      };
+
+    if (typeof item === 'object' && item['Artist'])
+      return {
+        artist: item['Artist'],
+        annotation: item['Annotation'] ?? null,
+      };
 
     if (typeof item !== 'string') return item;
 
@@ -401,8 +410,8 @@ export function parseContributors(contributionStrings) {
     if (!match) return item;
 
     return {
-      who: match.groups.main,
-      what: match.groups.accent ?? null,
+      artist: match.groups.main,
+      annotation: match.groups.accent ?? null,
     };
   });
 }