« 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
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
parent91136e5a3fedaa7c33d4df00b7e64829b5419157 (diff)
content: generateArtistGalleryPage: show co-illustrators
-rw-r--r--src/content/dependencies/generateArtistGalleryPage.js17
-rw-r--r--src/strings-default.json1
2 files changed, 18 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),
+                      }))),
             }),
         ],
 
diff --git a/src/strings-default.json b/src/strings-default.json
index a37c8d53..ec174a27 100644
--- a/src/strings-default.json
+++ b/src/strings-default.json
@@ -233,6 +233,7 @@
   "misc.contentWarnings.reveal": "click to show",
   "misc.albumGrid.details": "({TRACKS}, {TIME})",
   "misc.albumGrid.details.coverArtists": "(Illust. {ARTISTS})",
+  "misc.albumGrid.details.otherCoverArtists": "(With {ARTISTS})",
   "misc.albumGrid.noCoverArt": "{ALBUM}",
   "misc.albumGalleryGrid.noCoverArt": "{NAME}",
   "misc.uiLanguage": "UI Language: {LANGUAGES}",