« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page
diff options
context:
space:
mode:
Diffstat (limited to 'src/page')
-rw-r--r--src/page/artist.js5
-rw-r--r--src/page/group.js2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/page/artist.js b/src/page/artist.js
index 1b5a5060..6dd2ef30 100644
--- a/src/page/artist.js
+++ b/src/page/artist.js
@@ -87,6 +87,7 @@ export function write(artist, {wikiData}) {
         date: +track.date,
         album: track.album,
         duration: track.duration,
+        originalReleaseTrack: track.originalReleaseTrack,
         artists: track.artistContribs.some(({who}) => who === artist)
           ? track.artistContribs.filter(({who}) => who !== artist)
           : track.contributorContribs.filter(({who}) => who !== artist),
@@ -103,11 +104,11 @@ export function write(artist, {wikiData}) {
       date,
       album,
       chunk,
-      duration: getTotalDuration(chunk),
+      duration: getTotalDuration(chunk, {originalReleasesOnly: true}),
     }));
 
   const trackListChunks = chunkTracks(allTracks);
-  const totalDuration = getTotalDuration(allTracks);
+  const totalDuration = getTotalDuration(allTracks.filter(t => !t.originalReleaseTrack));
 
   const countGroups = (things) => {
     const usedGroups = things.flatMap(
diff --git a/src/page/group.js b/src/page/group.js
index c261565b..b181bcb2 100644
--- a/src/page/group.js
+++ b/src/page/group.js
@@ -18,7 +18,7 @@ export function write(group, {wikiData}) {
 
   const {albums} = group;
   const tracks = albums.flatMap((album) => album.tracks);
-  const totalDuration = getTotalDuration(tracks);
+  const totalDuration = getTotalDuration(tracks, {originalReleasesOnly: true});
 
   const albumLines = group.albums.map((album) => ({
     album,