diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-02-14 11:27:48 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-02-14 13:15:26 -0400 |
commit | fcf672f44b1e8ae3cf656e7e725f77eb5f2365c1 (patch) | |
tree | c307cf979edaad37b7f6c0b7e040ae7c567a62d9 /src | |
parent | c17fbefb7d3a8da87ebaee061a4d1a4af8dc03f0 (diff) |
content: generateArtistGalleryPage: sort by art date
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateArtistGalleryPage.js | 12 |
1 files changed, 10 insertions, 2 deletions
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}; }, |