« get me outta code hell

data steps: draft relations + clean lint errors - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateAlbumSocialEmbedDescription.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-03-19 16:07:43 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-03-19 16:07:43 -0300
commit7411fe87dc667b25f265f5388b790c5d4bbc880d (patch)
treeb730659ccf9399d492175fe36396dda8589df285 /src/content/dependencies/generateAlbumSocialEmbedDescription.js
parentc6e1a0b6fb9314186a46cf1352a8685e8aa5fe8d (diff)
data steps: draft relations + clean lint errors
Diffstat (limited to 'src/content/dependencies/generateAlbumSocialEmbedDescription.js')
-rw-r--r--src/content/dependencies/generateAlbumSocialEmbedDescription.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/content/dependencies/generateAlbumSocialEmbedDescription.js b/src/content/dependencies/generateAlbumSocialEmbedDescription.js
index 2bb62596..5fa67b26 100644
--- a/src/content/dependencies/generateAlbumSocialEmbedDescription.js
+++ b/src/content/dependencies/generateAlbumSocialEmbedDescription.js
@@ -1,10 +1,12 @@
+import {accumulateSum} from '../../util/sugar.js';
+
 export default {
   extraDependencies: ['language'],
 
   data(album) {
     const data = {};
 
-    const duration = getTotalDuration(album);
+    const duration = accumulateSum(album.tracks, track => track.duration);
 
     data.hasDuration = duration > 0;
     data.hasTracks = album.tracks.length > 0;