diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-03-07 12:23:12 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-12 17:26:43 -0300 |
commit | 1cf56b3364896cd0939b85b8b2fcb51155f9b69e (patch) | |
tree | 449a788ac5d138d37a89cf459abe6b1293f2fbf1 /src/content/dependencies/generateArtistInfoPageTracksChunkItem.js | |
parent | 0514493b06978ddcede0a3582b25e5c93d3f7477 (diff) |
content: gAIPTracks{ChunkedList,Chunk,ChunkItem}: data refactor
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageTracksChunkItem.js')
-rw-r--r-- | src/content/dependencies/generateArtistInfoPageTracksChunkItem.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js index d69ee30e..e7cba684 100644 --- a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js +++ b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js @@ -9,9 +9,14 @@ export default { extraDependencies: ['html', 'language'], - query (_artist, track, contribs) { + query (_artist, contribs) { const query = {}; + // TODO: Very mysterious what to do if the set of contributions is, + // in total, associated with more than one thing. No design yet. + query.track = + contribs[0].thing; + const creditedAsArtist = contribs .some(contrib => contrib.kind === 'artist'); @@ -59,12 +64,12 @@ export default { return query; }, - relations: (relation, _query, artist, track, contribs) => ({ + relations: (relation, query, artist, contribs) => ({ template: relation('generateArtistInfoPageChunkItem'), trackLink: - relation('linkTrack', track), + relation('linkTrack', query.track), otherArtistLinks: relation('generateArtistInfoPageOtherArtistLinks', @@ -72,12 +77,12 @@ export default { artist), }), - data: (query, _artist, track, _contribs) => ({ + data: (query) => ({ duration: - track.duration, + query.track.duration, rerelease: - track.isRerelease, + query.track.isRerelease, contribAnnotations: (query.displayedContributions |