diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-02-04 13:36:38 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-02-04 13:36:38 -0400 |
commit | b82bbd5e5ee13cdfc0c2dbdb7ed8f6ba8ff6e962 (patch) | |
tree | ea08b6965e5fae11d2e71ffc18ff6dce96a770a6 /src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js | |
parent | 0bde481020c75ac62fad2b28d053b4131313a7a3 (diff) |
content: generateArtistInfoPage: wiki editor commentary list
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js')
-rw-r--r-- | src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js index 711db34b..6c619f3c 100644 --- a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js +++ b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js @@ -19,7 +19,7 @@ export default { extraDependencies: ['html', 'language'], - query(artist) { + query(artist, filterWikiEditorCommentary) { const processEntry = ({ thing, entry, @@ -87,6 +87,12 @@ export default { .flatMap(thing => thing.commentary .filter(entry => entry.artists.includes(artist)) + + .filter(({annotation}) => + (filterWikiEditorCommentary + ? annotation?.startsWith(`wiki editor`) + : !annotation?.startsWith(`wiki editor`))) + .map(entry => processEntry({thing, entry}))); const processAlbumEntries = ({albums}) => @@ -146,7 +152,7 @@ export default { return {chunks}; }, - relations: (relation, query) => ({ + relations: (relation, query, _artist, filterWikiEditorCommentary) => ({ chunks: query.chunks .map(() => relation('generateArtistInfoPageChunk')), @@ -179,10 +185,13 @@ export default { query.chunks .map(({chunk}) => chunk .map(({annotation}) => - relation('transformContent', annotation))), + relation('transformContent', + (filterWikiEditorCommentary + ? annotation?.replace(/^wiki editor(, )?/, '') + : annotation)))), }), - data: (query) => ({ + data: (query, _artist, _filterWikiEditorCommentary) => ({ chunkTypes: query.chunks .map(({chunkType}) => chunkType), |