« get me outta code hell

content: listArtistsByDuration: use Artist.totalDurations - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-26 19:42:19 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:53 -0300
commit82c2cabd5f27bbb1989e7bd6af210f62b37b18c5 (patch)
treed47842ad8ae9aae204d32964293d6d2c009c3dff /src/content/dependencies
parent645c1ac3b6da0b80d4608c837c296b3a7b6a6401 (diff)
content: listArtistsByDuration: use Artist.totalDurations
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/listArtistsByDuration.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/content/dependencies/listArtistsByDuration.js b/src/content/dependencies/listArtistsByDuration.js
index 66fab8be..6b2a18a0 100644
--- a/src/content/dependencies/listArtistsByDuration.js
+++ b/src/content/dependencies/listArtistsByDuration.js
@@ -1,6 +1,5 @@
 import {sortAlphabetically, sortByCount} from '#sort';
-import {filterByCount, stitchArrays, unique} from '#sugar';
-import {getTotalDuration} from '#wiki-data';
+import {filterByCount, stitchArrays} from '#sugar';
 
 export default {
   contentDependencies: ['generateListingPage', 'linkArtist'],
@@ -16,13 +15,7 @@ export default {
         artistData.filter(artist => !artist.isAlias));
 
     const durations =
-      artists.map(artist =>
-        getTotalDuration(
-          unique([
-            ...(artist.tracksAsArtist ?? []),
-            ...(artist.tracksAsContributor ?? []),
-          ]),
-          {originalReleasesOnly: true}));
+      artists.map(artist => artist.totalDuration);
 
     filterByCount(artists, durations);
     sortByCount(artists, durations, {greatestFirst: true});