From 82c2cabd5f27bbb1989e7bd6af210f62b37b18c5 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 26 Apr 2024 19:42:19 -0300 Subject: content: listArtistsByDuration: use Artist.totalDurations --- src/content/dependencies/listArtistsByDuration.js | 11 ++--------- 1 file 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}); -- cgit 1.3.0-6-gf8a5