From 903e21d8afa9b3262194f641f8bee0955289bf21 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 27 Nov 2022 02:00:30 -0400 Subject: support & enable Sampled Tracks --- src/page/track.js | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'src/page') diff --git a/src/page/track.js b/src/page/track.js index b61defe2..4095f75a 100644 --- a/src/page/track.js +++ b/src/page/track.js @@ -24,7 +24,16 @@ export function targets({wikiData}) { export function write(track, {wikiData}) { const {wikiInfo} = wikiData; - const {album, referencedByTracks, referencedTracks, otherReleases} = track; + + const { + album, + contributorContribs, + referencedByTracks, + referencedTracks, + sampledByTracks, + sampledTracks, + otherReleases, + } = track; const listTag = getAlbumListTag(album); @@ -277,9 +286,9 @@ export function write(track, {wikiData}) { ]), ...html.fragment( - !empty(track.contributorContribs) && [ + !empty(contributorContribs) && [ html.tag('p', language.$('releaseInfo.contributors')), - html.tag('ul', track.contributorContribs.map(contrib => + html.tag('ul', contributorContribs.map(contrib => html.tag('li', getArtistString([contrib], { showContrib: true, showIcons: true, @@ -305,6 +314,22 @@ export function write(track, {wikiData}) { }), ]), + ...html.fragment( + !empty(sampledTracks) && [ + html.tag('p', language.$('releaseInfo.tracksSampled', { + track: html.tag('i', track.name), + })), + html.tag('ul', sampledTracks.map(getTrackItem)), + ]), + + ...html.fragment( + !empty(sampledByTracks) && [ + html.tag('p', language.$('releaseInfo.tracksThatSample', { + track: html.tag('i', track.name), + })), + html.tag('ul', sampledByTracks.map(getTrackItem)), + ]), + ...html.fragment( wikiInfo.enableFlashesAndGames && !empty(flashesThatFeature) && [ -- cgit 1.3.0-6-gf8a5