« get me outta code hell

content: generateArtistInfoPageFlashesChunkedList - 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-27 21:21:14 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-27 21:21:14 -0300
commitecde71b903a89607bf8c5032a1cda61a3ff1b3c5 (patch)
tree0359750c2fcafe28e6a1e883113e4f219e84eae3 /src/content/dependencies/generateArtistInfoPage.js
parentd3f13b864dddec7ef191aca769794695323ed498 (diff)
content: generateArtistInfoPageFlashesChunkedList
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPage.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPage.js97
1 files changed, 6 insertions, 91 deletions
diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js
index 561ae65..bfb3d60 100644
--- a/src/content/dependencies/generateArtistInfoPage.js
+++ b/src/content/dependencies/generateArtistInfoPage.js
@@ -4,16 +4,15 @@ import {getTotalDuration} from '../../util/wiki-data.js';
 export default {
   contentDependencies: [
     'generateArtistInfoPageArtworksChunkedList',
+    'generateArtistInfoPageFlashesChunkedList',
     'generateArtistInfoPageTracksChunkedList',
     'generateArtistNavLinks',
     'generateContentHeading',
     'generateCoverArtwork',
     'generatePageLayout',
     'linkAlbum',
-    'linkArtist',
     'linkArtistGallery',
     'linkExternal',
-    'linkFlash',
     'linkGroup',
     'linkTrack',
     'transformContent',
@@ -115,68 +114,11 @@ export default {
       // }
     }
 
-    /*
-    sortContributionEntries(artContributionEntries, sortAlbumsTracksChronologically);
-
-    const artContributionChunks =
-      chunkByProperties(artContributionEntries, ['album', 'date'])
-        .map(({album, date, chunk}) => ({
-          albumLink: relation('linkAlbum', album),
-          date: +date,
-          entries:
-            chunk.map(entry =>
-              filterProperties(entry, [
-                'contributionDescription',
-                'kind',
-                'otherArtistLinks',
-                'rerelease',
-                'trackLink',
-              ])),
-        }));
-    */
-
-    /*
-    // Flashes and games can list multiple contributors as collaborative
-    // credits, but we don't display these on the artist page, since they
-    // usually involve many artists crediting a larger team where collaboration
-    // isn't as relevant (without more particular details that aren't tracked
-    // on the wiki).
-
-    if (sprawl.enableFlashesAndGames) {
-      const flashEntries = [
-        ...artist.flashesAsContributor.map(flash => ({
-          date: +flash.date,
-          thing: flash,
-          act: flash.act,
-          flashLink: relation('linkFlash', flash),
-          // ...getContributionDescription(flash.contributorContribs),
-        })),
-      ];
-
-      sortContributionEntries(flashEntries, sortFlashesChronologically);
-
-      const flashChunks =
-        chunkByProperties(flashEntries, ['act'])
-          .map(({act, chunk}) => ({
-            actName: act.name,
-            actLink: relation('linkFlash', chunk[0].thing),
-            dateFirst: +chunk[0].date,
-            dateLast: +chunk[chunk.length - 1].date,
-            entries:
-              chunk.map(entry =>
-                filterProperties(entry, [
-                  'contributionDescription',
-                  'flashLink',
-                ])),
-          }));
-
-      if (!empty(flashChunks)) {
-        const flashes = sections.flashes = {};
-        flashes.heading = relation('generateContentHeading');
-        flashes.chunks = flashChunks;
-      }
+    if (sprawl.enableFlashesAndGames && !empty(artist.flashesAsContributor)) {
+      const flashes = sections.flashes = {};
+      flashes.heading = relation('generateContentHeading');
+      flashes.list = relation('generateArtistInfoPageFlashesChunkedList', artist);
     }
-    */
 
     /*
     // Commentary doesn't use the detailed contribution system where multiple
@@ -414,7 +356,6 @@ export default {
             */
           ],
 
-          /*
           sec.flashes && [
             sec.flashes.heading
               .slots({
@@ -423,34 +364,8 @@ export default {
                 title: language.$('artistPage.flashList.title'),
               }),
 
-            html.tag('dl',
-              sec.flashes.chunks.map(({
-                actName,
-                actLink,
-                entries,
-                dateFirst,
-                dateLast,
-              }) => [
-                html.tag('dt',
-                  language.$('artistPage.creditList.flashAct.withDateRange', {
-                    act: actLink.slot('content', actName),
-                    dateRange: language.formatDateRange(dateFirst, dateLast),
-                  })),
-
-                html.tag('dd',
-                  html.tag('ul',
-                    entries
-                      .map(({flashLink, ...properties}) => ({
-                        ...properties,
-                        entry: language.$('artistPage.creditList.entry.flash', {
-                          flash: flashLink,
-                        }),
-                      }))
-                      .map(addAccentsToEntry)
-                      .map(row => html.tag('li', row)))),
-              ])),
+            sec.flashes.list,
           ],
-          */
 
           /*
           sec.commentary && [