« get me outta code hell

content: generateTrackChronologyLinks: count contributions properly - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-23 16:57:13 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-30 20:48:18 -0300
commite2df11974850e3e890d3fdb4573947abc804e505 (patch)
tree7fce43055a785058d0767622d3b7946dfceddf63
parentb1fc03df98d7618f5a5189089bd810f243e9aa8c (diff)
content: generateTrackChronologyLinks: count contributions properly
-rw-r--r--src/content/dependencies/generateTrackChronologyLinks.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/content/dependencies/generateTrackChronologyLinks.js b/src/content/dependencies/generateTrackChronologyLinks.js
index e30dd9ba..15c2cae9 100644
--- a/src/content/dependencies/generateTrackChronologyLinks.js
+++ b/src/content/dependencies/generateTrackChronologyLinks.js
@@ -116,12 +116,12 @@ export default {
     ];
 
     const totalContributionCount =
-      accumulateSum(
-        contents.flatMap(content => [
-          content.artistChronologyContributions,
-          content.coverArtistChronologyContributions,
-        ]),
-        contributions => contributions.length);
+      Math.max(...
+        contents.map(content =>
+          accumulateSum([
+            content.artistChronologyContributions,
+            content.coverArtistChronologyContributions,
+          ], contributions => contributions.length)));
 
     relations.scopeSwitcher.setSlots({
       scopes,