From fcf672f44b1e8ae3cf656e7e725f77eb5f2365c1 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 14 Feb 2024 11:27:48 -0400 Subject: content: generateArtistGalleryPage: sort by art date --- src/content/dependencies/generateArtistGalleryPage.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/content/dependencies/generateArtistGalleryPage.js b/src/content/dependencies/generateArtistGalleryPage.js index 39be9d91..11cf8cdf 100644 --- a/src/content/dependencies/generateArtistGalleryPage.js +++ b/src/content/dependencies/generateArtistGalleryPage.js @@ -14,8 +14,16 @@ export default { extraDependencies: ['html', 'language'], query(artist) { - const things = [...artist.albumsAsCoverArtist, ...artist.tracksAsCoverArtist]; - sortAlbumsTracksChronologically(things, {latestFirst: true}); + const things = [ + ...artist.albumsAsCoverArtist, + ...artist.tracksAsCoverArtist, + ]; + + sortAlbumsTracksChronologically(things, { + latestFirst: true, + getDate: thing => thing.coverArtDate ?? thing.date, + }); + return {things}; }, -- cgit 1.3.0-6-gf8a5