From d3b56134bc051f4786c60991da40346227dc65eb Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 4 Nov 2025 09:30:07 -0400 Subject: content: gAIPChunk: albumLink, flashActLink slots -> link --- .../generateArtistInfoPageArtworksChunk.js | 2 +- .../dependencies/generateArtistInfoPageChunk.js | 78 +++++++++------------- .../generateArtistInfoPageCommentaryChunkedList.js | 4 +- .../generateArtistInfoPageFlashesChunk.js | 2 +- .../generateArtistInfoPageTracksChunk.js | 3 +- 5 files changed, 38 insertions(+), 51 deletions(-) (limited to 'src/content') 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, -- cgit 1.3.0-6-gf8a5