« get me outta code hell

content, page, util: general contributions usage cleanup - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateArtistInfoPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-02 10:55:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:54 -0300
commit5f16db8fc0f2b28f2014c439fb299ab34e7d4b1d (patch)
tree8b16a92879f67b76b65b49f72f5f6ef61643349d /src/content/dependencies/generateArtistInfoPage.js
parent69479b5bff9b88eab7e4b3e7fe972d7ee773dc36 (diff)
content, page, util: general contributions usage cleanup
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPage.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPage.js29
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);