« get me outta code hell

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:
Diffstat (limited to 'src/data/yaml.js')
-rw-r--r--src/data/yaml.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index d30bb54c..b766e753 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -794,7 +794,7 @@ export function parseArtwork({
   artistContribsFromThingProperty,
   artistContribsArtistProperty,
 }) {
-  return (entry, {subdoc, Artwork}) =>
+  const parseSingleEntry = (entry, {subdoc, Artwork}) =>
     subdoc(Artwork, entry, {
       bindInto: 'thing',
       provide: {
@@ -803,6 +803,11 @@ export function parseArtwork({
         artistContribsArtistProperty,
       },
     });
+
+  return (value, ...args) =>
+    (Array.isArray(value)
+      ? value.map(entry => parseSingleEntry(entry, ...args))
+      : [parseSingleEntry(value, ...args)]);
 }
 
 // documentModes: Symbols indicating sets of behavior for loading and processing