« get me outta code hell

content: gAIPCommentaryChunkedList: use new commentary properties - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-05-01 15:12:17 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-05-06 12:29:06 -0300
commitfb73207a7a94b994b9cbf471dfa5a46df911c1fe (patch)
tree989401d15f810a9fa455f0becea39f2a641c5da1 /src/content/dependencies
parent97ec3e59db827876ea5b4233afac37407553be50 (diff)
content: gAIPCommentaryChunkedList: use new commentary properties
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
index d0c5e14e..88c5ed54 100644
--- a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
+++ b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
@@ -43,6 +43,7 @@ export default {
         flash,
 
         annotation: entry.annotation,
+        annotationParts: entry.annotationParts,
       },
     });
 
@@ -88,10 +89,10 @@ export default {
           thing.commentary
             .filter(entry => entry.artists.includes(artist))
 
-            .filter(({annotation}) =>
+            .filter(entry =>
               (filterWikiEditorCommentary
-                ? annotation?.match(/^wiki editor/i)
-                : !annotation?.match(/^wiki editor/i)))
+                ? entry.isWikiEditorCommentary
+                : !entry.isWikiEditorCommentary))
 
             .map(entry => processEntry({thing, entry})));
 
@@ -184,11 +185,13 @@ export default {
     itemAnnotations:
       query.chunks
         .map(({chunk}) => chunk
-          .map(({annotation}) =>
+          .map(entry =>
             relation('transformContent',
               (filterWikiEditorCommentary
-                ? annotation?.replace(/^wiki editor(, )?/i, '')
-                : annotation)))),
+                ? entry.annotationParts
+                    .filter(part => part !== 'wiki editor')
+                    .join(', ')
+                : entry.annotation)))),
   }),
 
   data: (query, _artist, _filterWikiEditorCommentary) => ({