From 2912e0f77cf3f9f30c49c0ab22abecc9da6fb0db Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 21 Jul 2023 12:15:03 -0300 Subject: content: pre-sort existing listings --- src/content/dependencies/listAlbumsByTracks.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/content/dependencies/listAlbumsByTracks.js') diff --git a/src/content/dependencies/listAlbumsByTracks.js b/src/content/dependencies/listAlbumsByTracks.js index c31609bd..d28a564e 100644 --- a/src/content/dependencies/listAlbumsByTracks.js +++ b/src/content/dependencies/listAlbumsByTracks.js @@ -1,5 +1,10 @@ import {stitchArrays} 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', 'linkAlbum'], @@ -10,7 +15,7 @@ export default { }, query({albumData}, spec) { - const albums = albumData.slice(); + const albums = sortAlphabetically(albumData.slice()); const counts = albums.map(album => album.tracks.length); filterByCount(albums, counts); -- cgit 1.3.0-6-gf8a5