« get me outta code hell

content: generateArtistInfoPageCommentaryChunkedList - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateArtistInfoPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-30 17:09:10 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-30 17:09:10 -0300
commitc0d76a612f3a1db99c60f494d2bdcc05fa7c6679 (patch)
tree021aa89eaac5c9c2e00339f9a53b9808b0cd5498 /src/content/dependencies/generateArtistInfoPage.js
parent6758dd090ba6c3c7ea84a4b7d6fab0a0c26ad13e (diff)
content: generateArtistInfoPageCommentaryChunkedList
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPage.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPage.js67
1 files changed, 4 insertions, 63 deletions
diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js
index a3d159af..6956244b 100644
--- a/src/content/dependencies/generateArtistInfoPage.js
+++ b/src/content/dependencies/generateArtistInfoPage.js
@@ -5,6 +5,7 @@ export default {
   contentDependencies: [
     'generateArtistGroupContributionsInfo',
     'generateArtistInfoPageArtworksChunkedList',
+    'generateArtistInfoPageCommentaryChunkedList',
     'generateArtistInfoPageFlashesChunkedList',
     'generateArtistInfoPageTracksChunkedList',
     'generateArtistNavLinks',
@@ -99,51 +100,11 @@ export default {
       flashes.list = relation('generateArtistInfoPageFlashesChunkedList', artist);
     }
 
-    /*
-    // Commentary doesn't use the detailed contribution system where multiple
-    // artists are collaboratively credited for the same piece, so there isn't
-    // really anything special to do for processing or presenting it.
-
-    const commentaryEntries = [
-      ...artist.albumsAsCommentator.map(album => ({
-        kind: 'albumCommentary',
-        date: album.date,
-        thing: album,
-        album: album,
-      })),
-
-      ...artist.tracksAsCommentator.map(track => ({
-        kind: 'trackCommentary',
-        date: track.date,
-        thing: track,
-        album: track.album,
-        trackLink: relation('linkTrack', track),
-      })),
-    ];
-
-    sortContributionEntries(commentaryEntries, sortAlbumsTracksChronologically);
-
-    // We still pass through (and chunk by) date here, even though it doesn't
-    // actually get displayed on the album page. See issue #193.
-    const commentaryChunks =
-      chunkByProperties(commentaryEntries, ['album', 'date'])
-        .map(({album, date, chunk}) => ({
-          albumLink: relation('linkAlbum', album),
-          date: +date,
-          entries:
-            chunk.map(entry =>
-              filterProperties(entry, [
-                'kind',
-                'trackLink',
-              ])),
-        }));
-
-    if (!empty(commentaryChunks)) {
+    if (!empty(artist.albumsAsCommentator) || !empty(artist.tracksAsCommentator)) {
       const commentary = sections.commentary = {};
       commentary.heading = relation('generateContentHeading');
-      commentary.chunks = commentaryChunks;
+      commentary.list = relation('generateArtistInfoPageCommentaryChunkedList', artist);
     }
-    */
 
     return relations;
   },
@@ -295,7 +256,6 @@ export default {
             sec.flashes.list,
           ],
 
-          /*
           sec.commentary && [
             sec.commentary.heading
               .slots({
@@ -304,27 +264,8 @@ export default {
                 title: language.$('artistPage.commentaryList.title'),
               }),
 
-            html.tag('dl',
-              sec.commentary.chunks.map(({albumLink, entries}) => [
-                html.tag('dt',
-                  language.$('artistPage.creditList.album', {
-                    album: albumLink,
-                  })),
-
-                html.tag('dd',
-                  html.tag('ul',
-                    entries
-                      .map(({kind, trackLink}) =>
-                        (kind === 'trackCommentary'
-                          ? language.$('artistPage.creditList.entry.track', {
-                              track: trackLink,
-                            })
-                          : html.tag('i',
-                              language.$('artistPage.creditList.entry.album.commentary'))))
-                      .map(entry => html.tag('li', entry)))),
-              ])),
+            sec.commentary.list,
           ],
-          */
         ],
 
         navLinkStyle: 'hierarchical',