From 5f16db8fc0f2b28f2014c439fb299ab34e7d4b1d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 2 Jun 2024 10:55:38 -0300 Subject: content, page, util: general contributions usage cleanup --- src/content/dependencies/generateArtistInfoPage.js | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'src/content/dependencies/generateArtistInfoPage.js') diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js index d1941b91..88e501ce 100644 --- a/src/content/dependencies/generateArtistInfoPage.js +++ b/src/content/dependencies/generateArtistInfoPage.js @@ -31,25 +31,32 @@ export default { return { // Even if an artist has served as both "artist" (compositional) and // "contributor" (instruments, production, etc) on the same track, that - // track only counts as one unique contribution. + // track only counts as one unique contribution in the list. allTracks: - unique([...artist.tracksAsArtist, ...artist.tracksAsContributor]), + unique( + ([ + artist.trackArtistContributions, + artist.trackContributorContributions, + ]).flat() + .map(({thing}) => thing)), // Artworks are different, though. We intentionally duplicate album data // objects when the artist has contributed some combination of cover art, // wallpaper, and banner - these each count as a unique contribution. - allArtworks: [ - ...artist.albumsAsCoverArtist, - ...artist.albumsAsWallpaperArtist, - ...artist.albumsAsBannerArtist, - ...artist.tracksAsCoverArtist, - ], + allArtworks: + ([ + artist.albumCoverArtistContributions, + artist.albumWallpaperArtistContributions, + artist.albumBannerArtistContributions, + artist.trackCoverArtistContributions, + ]).flat() + .map(({thing}) => thing), // Banners and wallpapers don't show up in the artist gallery page, only // cover art. hasGallery: - !empty(artist.albumsAsCoverArtist) || - !empty(artist.tracksAsCoverArtist), + !empty(artist.albumCoverArtistContributions) || + !empty(artist.trackCoverArtistContributions), }; }, @@ -100,7 +107,7 @@ export default { } } - if (sprawl.enableFlashesAndGames && !empty(artist.flashesAsContributor)) { + if (sprawl.enableFlashesAndGames && !empty(artist.flashContributorContributions)) { const flashes = sections.flashes = {}; flashes.heading = relation('generateContentHeading'); flashes.list = relation('generateArtistInfoPageFlashesChunkedList', artist); -- cgit 1.3.0-6-gf8a5