« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/listArtistsByContributions.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/content/dependencies/listArtistsByContributions.js b/src/content/dependencies/listArtistsByContributions.js
index 234c7edd..61141155 100644
--- a/src/content/dependencies/listArtistsByContributions.js
+++ b/src/content/dependencies/listArtistsByContributions.js
@@ -107,22 +107,28 @@ export default {
   },
 
   generate(data, relations, {language}) {
-    const listChunkIDs = ['tracks', 'artworks', 'flashes'];
-    const listTitleStringsKeys = ['trackContributors', 'artContributors', 'flashContributors'];
-    const listCountFunctions = ['countTracks', 'countArtworks', 'countFlashes'];
+    const listChunkIDs = ['tracks', 'artworks'];
+    const listTitleStringsKeys = ['trackContributors', 'artContributors'];
+    const listCountFunctions = ['countTracks', 'countArtworks'];
 
     const listArtistLinks = [
       relations.artistLinksByTrackContributions,
       relations.artistLinksByArtworkContributions,
-      relations.artistLinksByFlashContributions,
     ];
 
     const listArtistCounts = [
       data.countsByTrackContributions,
       data.countsByArtworkContributions,
-      data.countsByFlashContributions,
     ];
 
+    if (data.enableFlashesAndGames) {
+      listChunkIDs.push('flashes');
+      listTitleStringsKeys.push('flashContributors');
+      listCountFunctions.push('countFlashes');
+      listArtistLinks.push(relations.artistLinksByFlashContributions);
+      listArtistCounts.push(data.countsByFlashContributions);
+    }
+
     filterMultipleArrays(
       listChunkIDs,
       listTitleStringsKeys,