From 7a5910ad40d7fe36289e8ba3bc749284695cf719 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 2 Feb 2026 18:05:46 -0400 Subject: content: gAIPTracksChunkedList: album artist only --- src/common-util/wiki-data.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/common-util') diff --git a/src/common-util/wiki-data.js b/src/common-util/wiki-data.js index de34a807..c9c63db7 100644 --- a/src/common-util/wiki-data.js +++ b/src/common-util/wiki-data.js @@ -256,13 +256,18 @@ export function getArtistAvatar(artist, {to}) { // Used in multiple content functions for the artist info page, // because shared logic is torture oooooooooooooooo. export function chunkArtistTrackContributions(contributions) { + const date = contrib => contrib.date; + + const album = contrib => + (contrib.thing.isTrack + ? contrib.thing.album + : contrib.thing); + return ( // First chunk by (contribution) date and album. chunkByConditions(contributions, [ - ({date: date1}, {date: date2}) => - +date1 !== +date2, - ({thing: track1}, {thing: track2}) => - track1.album !== track2.album, + (a, b) => +date(a) !== +date(b), + (a, b) => album(a) !== album(b), ]).map(contribs => // Then, *within* the boundaries of the existing chunks, // chunk contributions to the same thing together. -- cgit 1.3.0-6-gf8a5