« get me outta code hell

content: use stitchArrays in various places - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateArtistGalleryPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-23 20:01:21 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-23 20:01:21 -0300
commitc8332bb4e9b719eae0bc8f758ab1835ea1b4d0e8 (patch)
tree12476c2eee53d6ed95b9f63f16818e66ac13c7a1 /src/content/dependencies/generateArtistGalleryPage.js
parent89e79008b02331b69660bb16b6ca737e37483e61 (diff)
content: use stitchArrays in various places
Diffstat (limited to 'src/content/dependencies/generateArtistGalleryPage.js')
-rw-r--r--src/content/dependencies/generateArtistGalleryPage.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/content/dependencies/generateArtistGalleryPage.js b/src/content/dependencies/generateArtistGalleryPage.js
index 41758d5..d1ec3ef 100644
--- a/src/content/dependencies/generateArtistGalleryPage.js
+++ b/src/content/dependencies/generateArtistGalleryPage.js
@@ -1,3 +1,4 @@
+import {stitchArrays} from '../../util/sugar.js';
 import {sortAlbumsTracksChronologically} from '../../util/wiki-data.js';
 
 // TODO: Very awkward we have to duplicate this functionality in relations and data.
@@ -92,10 +93,11 @@ export default {
               links: relations.links,
               names: data.names,
               images:
-                relations.images.map((image, i) =>
-                  image.slots({
-                    path: data.paths[i],
-                  })),
+                stitchArrays({
+                  image: relations.images,
+                  path: data.paths,
+                }).map(({image, path}) =>
+                    image.slot('path', path)),
             }),
         ],