« get me outta code hell

content: pre-sort existing listings - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/listArtistsByContributions.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-07-21 12:15:03 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-07-21 12:15:03 -0300
commit2912e0f77cf3f9f30c49c0ab22abecc9da6fb0db (patch)
treec4745b90f791169d60daa625a7fe82b2a92222cd /src/content/dependencies/listArtistsByContributions.js
parentfa57fb3e3a0fd628e134fbe25102cbc3aa8a1c70 (diff)
content: pre-sort existing listings
Diffstat (limited to 'src/content/dependencies/listArtistsByContributions.js')
-rw-r--r--src/content/dependencies/listArtistsByContributions.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/content/dependencies/listArtistsByContributions.js b/src/content/dependencies/listArtistsByContributions.js
index 442b832..63c8d4b 100644
--- a/src/content/dependencies/listArtistsByContributions.js
+++ b/src/content/dependencies/listArtistsByContributions.js
@@ -1,5 +1,10 @@
 import {stitchArrays, unique} from '../../util/sugar.js';
-import {filterByCount, sortByCount} from '../../util/wiki-data.js';
+
+import {
+  filterByCount,
+  sortAlphabetically,
+  sortByCount,
+} from '../../util/wiki-data.js';
 
 export default {
   contentDependencies: ['generateListingPage', 'linkArtist'],
@@ -19,7 +24,7 @@ export default {
     };
 
     const queryContributionInfo = (artistsKey, countsKey, fn) => {
-      const artists = sprawl.artistData.slice();
+      const artists = sortAlphabetically(sprawl.artistData.slice());
       const counts = artists.map(artist => fn(artist));
 
       filterByCount(artists, counts);