« 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/generateAlbumGalleryPage.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/generateAlbumGalleryPage.js
parent89e79008b02331b69660bb16b6ca737e37483e61 (diff)
content: use stitchArrays in various places
Diffstat (limited to 'src/content/dependencies/generateAlbumGalleryPage.js')
-rw-r--r--src/content/dependencies/generateAlbumGalleryPage.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/content/dependencies/generateAlbumGalleryPage.js b/src/content/dependencies/generateAlbumGalleryPage.js
index 354c8401..71cd477b 100644
--- a/src/content/dependencies/generateAlbumGalleryPage.js
+++ b/src/content/dependencies/generateAlbumGalleryPage.js
@@ -1,3 +1,5 @@
+import {stitchArrays} from '../../util/sugar.js';
+
 export default {
   contentDependencies: [
     'generateAlbumGalleryInfoLine',
@@ -89,14 +91,16 @@ export default {
               links: relations.links,
               names: data.names,
               images:
-                relations.images.map((image, i) =>
-                  image.slots({
-                    path: data.paths[i],
-                    missingSourceContent:
-                      language.$('misc.albumGalleryGrid.noCoverArt', {
-                        name: data.names[i],
-                      }),
-                  })),
+                stitchArrays({
+                  image: relations.images,
+                  path: data.paths,
+                  name: data.names,
+                }).map(({image, path, name}) =>
+                    image.slots({
+                      path,
+                      missingSourceContent:
+                        language.$('misc.albumGalleryGrid.noCoverArt', {name}),
+                    })),
             }),
         ],