« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
index 2892152e..41cb3017 100644
--- a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
+++ b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
@@ -19,10 +19,13 @@ export default {
 
   query(artist) {
     const processEntries = (things, details) =>
-      things.map(thing => ({
-        thing,
-        entry: details(thing),
-      }));
+      things.flatMap(thing =>
+        thing.commentary
+          .filter(entry => entry.artists.includes(artist))
+          .map(entry => ({
+            thing,
+            entry: details(thing, entry),
+          })));
 
     const albumEntries =
       processEntries(