« get me outta code hell

content: gAIPChunk: albumLink, flashActLink slots -> link - 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>2025-11-04 09:30:07 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-11-04 09:30:07 -0400
commitd3b56134bc051f4786c60991da40346227dc65eb (patch)
tree95d166c9a64a0154c6a17c5613fa233f9615afaf /src/content
parente2d8c60381d6c712de3a7bdacd8d9fcb8b570897 (diff)
content: gAIPChunk: albumLink, flashActLink slots -> link
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateArtistInfoPageArtworksChunk.js2
-rw-r--r--src/content/dependencies/generateArtistInfoPageChunk.js78
-rw-r--r--src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js4
-rw-r--r--src/content/dependencies/generateArtistInfoPageFlashesChunk.js2
-rw-r--r--src/content/dependencies/generateArtistInfoPageTracksChunk.js3
5 files changed, 38 insertions, 51 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageArtworksChunk.js b/src/content/dependencies/generateArtistInfoPageArtworksChunk.js
index a7bbcc27..eb15d54b 100644
--- a/src/content/dependencies/generateArtistInfoPageArtworksChunk.js
+++ b/src/content/dependencies/generateArtistInfoPageArtworksChunk.js
@@ -28,7 +28,7 @@ export default {
   generate: (data, relations, slots, {html}) =>
     relations.template.slots({
       mode: 'album',
-      albumLink: relations.albumLink,
+      link: relations.albumLink,
 
       dates:
         (slots.filterEditsForWiki
diff --git a/src/content/dependencies/generateArtistInfoPageChunk.js b/src/content/dependencies/generateArtistInfoPageChunk.js
index 7fa0cfb5..3fa46c61 100644
--- a/src/content/dependencies/generateArtistInfoPageChunk.js
+++ b/src/content/dependencies/generateArtistInfoPageChunk.js
@@ -8,12 +8,7 @@ export default {
 
     id: {type: 'string'},
 
-    albumLink: {
-      type: 'html',
-      mutable: false,
-    },
-
-    flashActLink: {
+    link: {
       type: 'html',
       mutable: false,
     },
@@ -51,50 +46,43 @@ export default {
     }
 
     let accentedLink;
-
-    accent: {
-      switch (slots.mode) {
-        case 'album': {
-          accentedLink = slots.albumLink;
-
-          const options = {album: accentedLink};
-          const parts = ['artistPage.creditList.album'];
-
-          if (onlyDate) {
-            parts.push('withDate');
-            options.date = language.formatDate(onlyDate);
-          }
-
-          if (slots.duration) {
-            parts.push('withDuration');
-            options.duration =
-              language.formatDuration(slots.duration, {
-                approximate: slots.durationApproximate,
-              });
-          }
-
-          accentedLink = language.formatString(...parts, options);
-          break;
+    switch (slots.mode) {
+      case 'album': {
+        const options = {album: slots.link};
+        const parts = ['artistPage.creditList.album'];
+
+        if (onlyDate) {
+          parts.push('withDate');
+          options.date = language.formatDate(onlyDate);
         }
 
-        case 'flash': {
-          accentedLink = slots.flashActLink;
-
-          const options = {act: accentedLink};
-          const parts = ['artistPage.creditList.flashAct'];
+        if (slots.duration) {
+          parts.push('withDuration');
+          options.duration =
+            language.formatDuration(slots.duration, {
+              approximate: slots.durationApproximate,
+            });
+        }
 
-          if (onlyDate) {
-            parts.push('withDate');
-            options.date = language.formatDate(onlyDate);
-          } else if (earliestDate && latestDate) {
-            parts.push('withDateRange');
-            options.dateRange =
-              language.formatDateRange(earliestDate, latestDate);
-          }
+        accentedLink = language.formatString(...parts, options);
+        break;
+      }
 
-          accentedLink = language.formatString(...parts, options);
-          break;
+      case 'flash': {
+        const options = {act: slots.link};
+        const parts = ['artistPage.creditList.flashAct'];
+
+        if (onlyDate) {
+          parts.push('withDate');
+          options.date = language.formatDate(onlyDate);
+        } else if (earliestDate && latestDate) {
+          parts.push('withDateRange');
+          options.dateRange =
+            language.formatDateRange(earliestDate, latestDate);
         }
+
+        accentedLink = language.formatString(...parts, options);
+        break;
       }
     }
 
diff --git a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
index a92f41a6..08446a2e 100644
--- a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
+++ b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js
@@ -220,7 +220,7 @@ export default {
             (chunkType === 'album'
               ? chunk.slots({
                   mode: 'album',
-                  albumLink: chunkLink,
+                  link: chunkLink,
 
                   list:
                     html.tag('ul',
@@ -248,7 +248,7 @@ export default {
              : chunkType === 'flash-act'
               ? chunk.slots({
                   mode: 'flash',
-                  flashActLink: chunkLink,
+                  link: chunkLink,
 
                   list:
                     html.tag('ul',
diff --git a/src/content/dependencies/generateArtistInfoPageFlashesChunk.js b/src/content/dependencies/generateArtistInfoPageFlashesChunk.js
index c44c151c..ce89d80c 100644
--- a/src/content/dependencies/generateArtistInfoPageFlashesChunk.js
+++ b/src/content/dependencies/generateArtistInfoPageFlashesChunk.js
@@ -21,7 +21,7 @@ export default {
   generate: (data, relations, {html}) =>
     relations.template.slots({
       mode: 'flash',
-      flashActLink: relations.flashActLink,
+      link: relations.flashActLink,
       dates: data.dates,
 
       list:
diff --git a/src/content/dependencies/generateArtistInfoPageTracksChunk.js b/src/content/dependencies/generateArtistInfoPageTracksChunk.js
index 2d932cbb..ed3177b1 100644
--- a/src/content/dependencies/generateArtistInfoPageTracksChunk.js
+++ b/src/content/dependencies/generateArtistInfoPageTracksChunk.js
@@ -49,8 +49,7 @@ export default {
   generate: (data, relations, {html}) =>
     relations.template.slots({
       mode: 'album',
-
-      albumLink: relations.albumLink,
+      link: relations.albumLink,
 
       dates: data.dates,
       duration: data.duration,