diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-06-02 10:55:38 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-18 22:56:06 -0300 |
commit | 4aa153ebae1360e390b9d372fabf457ee8b21705 (patch) | |
tree | a1cff366b439550227fa6ef7b9b4f6c575e51daf /src/content/dependencies/generateArtistInfoPage.js | |
parent | 5550f8ec487c3cae87de36f4e0c1fe9d6df8e36c (diff) |
content, page, util: general contributions usage cleanup
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPage.js')
-rw-r--r-- | src/content/dependencies/generateArtistInfoPage.js | 29 |
1 files changed, 18 insertions, 11 deletions
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); |