« get me outta code hell

content: gAIPCommentaryChunkedList: commentary entry annotations - 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>2024-02-06 10:11:56 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-02-06 10:11:56 -0400
commitbb3fbea9b650d79c4ca797524818ea7893c74570 (patch)
treed1c2ca4b7f8b78a04953af9aa2169dc0de20738e /src/content
parentc687af21ffbc1fcb4e12d26e4c68af8faf9ce0e8 (diff)
content: gAIPCommentaryChunkedList: commentary entry annotations
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
index 41cb3017..dad1585a 100644
--- a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
+++ b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
@@ -13,6 +13,7 @@ export default {
     'generateArtistInfoPageOtherArtistLinks',
     'linkAlbum',
     'linkTrack',
+    'transformContent',
   ],
 
   extraDependencies: ['html', 'language'],
@@ -24,7 +25,10 @@ export default {
           .filter(entry => entry.artists.includes(artist))
           .map(entry => ({
             thing,
-            entry: details(thing, entry),
+            entry: {
+              annotation: entry.annotation,
+              ...details(thing, entry),
+            },
           })));
 
     const albumEntries =
@@ -73,7 +77,17 @@ export default {
 
       itemTrackLinks:
         query.chunks.map(({chunk}) =>
-          chunk.map(({track}) => track ? relation('linkTrack', track) : null)),
+          chunk.map(({track}) =>
+            (track
+              ? relation('linkTrack', track)
+              : null))),
+
+      itemAnnotations:
+        query.chunks.map(({chunk}) =>
+          chunk.map(({annotation}) =>
+            (annotation
+              ? relation('transformContent', annotation)
+              : null))),
     };
   },
 
@@ -93,8 +107,17 @@ export default {
 
         items: relations.items,
         itemTrackLinks: relations.itemTrackLinks,
+        itemAnnotations: relations.itemAnnotations,
         itemTypes: data.itemTypes,
-      }).map(({chunk, albumLink, items, itemTrackLinks, itemTypes}) =>
+      }).map(({
+          chunk,
+          albumLink,
+
+          items,
+          itemTrackLinks,
+          itemAnnotations,
+          itemTypes,
+        }) =>
           chunk.slots({
             mode: 'album',
             albumLink,
@@ -102,9 +125,15 @@ export default {
               stitchArrays({
                 item: items,
                 trackLink: itemTrackLinks,
+                annotation: itemAnnotations,
                 type: itemTypes,
-              }).map(({item, trackLink, type}) =>
+              }).map(({item, trackLink, annotation, type}) =>
                 item.slots({
+                  annotation:
+                    (annotation
+                      ? annotation.slot('mode', 'inline')
+                      : null),
+
                   content:
                     (type === 'album'
                       ? html.tag('i',