« get me outta code hell

only count originals for total duration in most places - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-11-27 01:30:24 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-11-27 01:30:24 -0400
commit398e8c25073a88cbf7e9861445c87dc9e995978a (patch)
treebd7567bffa6afb23e242be11cc36bc5fd95c810b /src/util
parentdd4e642b381f1af8f235a1eff4eb886b12be31ad (diff)
only count originals for total duration in most places
Diffstat (limited to 'src/util')
-rw-r--r--src/util/wiki-data.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js
index f0812a08..c93cb661 100644
--- a/src/util/wiki-data.js
+++ b/src/util/wiki-data.js
@@ -395,7 +395,13 @@ export function getFlashLink(flash) {
   return `https://homestuck.com/story/${flash.page}`;
 }
 
-export function getTotalDuration(tracks) {
+export function getTotalDuration(tracks, {
+  originalReleasesOnly = false,
+} = {}) {
+  if (originalReleasesOnly) {
+    tracks = tracks.filter(t => !t.originalReleaseTrack);
+  }
+
   return accumulateSum(tracks, track => track.duration);
 }