« get me outta code hell

content: generateArtistGalleryPage: show co-illustrators - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-06 20:29:48 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-06 20:29:48 -0300
commit31a15f783f915811990cefb90fe1661293c49f3d (patch)
treef56f7357554a89f91b159d0219d082eed47c6a94 /src/content
parent91136e5a3fedaa7c33d4df00b7e64829b5419157 (diff)
content: generateArtistGalleryPage: show co-illustrators
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateArtistGalleryPage.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/content/dependencies/generateArtistGalleryPage.js b/src/content/dependencies/generateArtistGalleryPage.js
index 98fa2dcb..b1172904 100644
--- a/src/content/dependencies/generateArtistGalleryPage.js
+++ b/src/content/dependencies/generateArtistGalleryPage.js
@@ -60,6 +60,14 @@ export default {
           ? ['media.trackCover', thing.album.directory, thing.directory, thing.coverArtFileExtension]
           : ['media.albumCover', thing.directory, thing.coverArtFileExtension]));
 
+    data.otherCoverArtists =
+      query.things.map(thing =>
+        (thing.coverArtistContribs.length > 1
+          ? thing.coverArtistContribs
+              .filter(({who}) => who !== artist)
+              .map(({who}) => who.name)
+          : null));
+
     return data;
   },
 
@@ -87,12 +95,21 @@ export default {
             .slots({
               links: relations.links,
               names: data.names,
+
               images:
                 stitchArrays({
                   image: relations.images,
                   path: data.paths,
                 }).map(({image, path}) =>
                     image.slot('path', path)),
+
+              info:
+                data.otherCoverArtists.map(names =>
+                  (names === null
+                    ? null
+                    : language.$('misc.albumGrid.details.otherCoverArtists', {
+                        artists: language.formatUnitList(names),
+                      }))),
             }),
         ],