« get me outta code hell

content: generateAlbumCommentaryPage: miscellaneous fixes/updates - 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-11-26 13:47:40 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-26 13:47:40 -0400
commit09f67bdb9438618fe8632d0d8ceda8fee12b8cb7 (patch)
tree376136f5e8639456a3a408dd78a598a1af5da646
parent692bd586495e5fcb6d7c5eae2af6a8c34b380b50 (diff)
content: generateAlbumCommentaryPage: miscellaneous fixes/updates
-rw-r--r--src/content/dependencies/generateAlbumCommentaryPage.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/content/dependencies/generateAlbumCommentaryPage.js b/src/content/dependencies/generateAlbumCommentaryPage.js
index 442d72a7..5a7142e5 100644
--- a/src/content/dependencies/generateAlbumCommentaryPage.js
+++ b/src/content/dependencies/generateAlbumCommentaryPage.js
@@ -107,11 +107,15 @@ export default {
         ? [album, ...tracksWithCommentary]
         : tracksWithCommentary);
 
-    data.entryCount = thingsWithCommentary.length;
+    data.entryCount =
+      thingsWithCommentary
+        .flatMap(({commentary}) => commentary)
+        .length;
 
     data.wordCount =
       thingsWithCommentary
-        .map(({commentary}) => commentary)
+        .flatMap(({commentary}) => commentary)
+        .map(({body}) => body)
         .join(' ')
         .split(' ')
         .length;
@@ -156,7 +160,7 @@ export default {
                   language.countCommentaryEntries(data.entryCount, {unit: true})),
             })),
 
-          relations.albumCommentaryContent && [
+          relations.albumCommentaryEntries && [
             relations.albumCommentaryHeading.slots({
               tag: 'h3',
               color: data.color,
@@ -173,7 +177,7 @@ export default {
                       language.formatUnitList(
                         relations.albumCommentaryListeningLinks
                           .map(link => link.slots({
-                            mode: 'album',
+                            context: 'album',
                             tab: 'separate',
                           }))),
                   }),
@@ -182,8 +186,7 @@ export default {
             relations.albumCommentaryCover
               ?.slots({mode: 'commentary'}),
 
-            html.tag('blockquote',
-              relations.albumCommentaryContent),
+            relations.albumCommentaryEntries,
           ],
 
           stitchArrays({