« get me outta code hell

content: gAIPTracksChunk: hide durations in uncounted list - 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>2026-01-11 10:28:50 -0400
committer(quasar) nebula <qznebula@protonmail.com>2026-01-11 10:28:50 -0400
commitbea6277b095d9cf371f7975dc4328da974cef70e (patch)
tree26a5a52197b444079e73e16448dc686a2f6e521f /src/content/dependencies
parent7d3bba95acc8086c15e9b75c21496c1b4133896b (diff)
content: gAIPTracksChunk: hide durations in uncounted list
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateArtistInfoPageTracksChunk.js3
-rw-r--r--src/content/dependencies/generateArtistInfoPageTracksChunkItem.js11
2 files changed, 11 insertions, 3 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageTracksChunk.js b/src/content/dependencies/generateArtistInfoPageTracksChunk.js
index 00e581e3..d964c5de 100644
--- a/src/content/dependencies/generateArtistInfoPageTracksChunk.js
+++ b/src/content/dependencies/generateArtistInfoPageTracksChunk.js
@@ -113,7 +113,8 @@ export default {
               html.tag('li', {class: 'divider'},
                 html.tag('hr')),
 
-            relations.itemsNotCountingTowardTotals,
+            relations.itemsNotCountingTowardTotals
+              .map(item => item.slot('showDuration', false)),
           ]),
     }),
 };
diff --git a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
index e976c57f..5273ff53 100644
--- a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
+++ b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
@@ -116,7 +116,14 @@ export default {
         : null),
   }),
 
-  generate: (data, relations, {html, language}) =>
+  slots: {
+    showDuration: {
+      type: 'boolean',
+      default: true,
+    },
+  },
+
+  generate: (data, relations, slots, {html, language}) =>
     relations.template.slots({
       otherArtistLinks: relations.otherArtistLinks,
       rereleaseTooltip: relations.rereleaseTooltip,
@@ -131,7 +138,7 @@ export default {
         language.encapsulate('artistPage.creditList.entry.track', workingCapsule => {
           const workingOptions = {track: relations.trackLink};
 
-          if (data.duration) {
+          if (slots.showDuration && data.duration) {
             workingCapsule += '.withDuration';
             workingOptions.duration =
               language.formatDuration(data.duration);