From 5359233d272e4e7397b8cb81e7c1711e0f414240 Mon Sep 17 00:00:00 2001
From: "(quasar) nebula"
Date: Mon, 29 Mar 2021 14:36:30 -0300
Subject: chunk artist track lists by original date again!
i.e, show and chunk by original & art release dates as appropriate.
---
upd8.js | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/upd8.js b/upd8.js
index 74b4a67b..cb351940 100755
--- a/upd8.js
+++ b/upd8.js
@@ -3068,9 +3068,10 @@ function writeArtistPage(artist) {
.map(props => ({
album: thing.album || thing,
track: thing.album ? thing : null,
+ date: +(thing.coverArtDate || thing.date),
...props
})))
- ), ['album']);
+ ), ['date', 'album']);
const commentaryListChunks = chunkByProperties(commentaryThings.map(thing => ({
album: thing.album || thing,
@@ -3084,6 +3085,7 @@ function writeArtistPage(artist) {
const chunkTracks = tracks => (
chunkByProperties(tracks.map(track => ({
track,
+ date: +track.date,
album: track.album,
duration: track.duration,
artists: (track.artists.some(({ who }) => who === artist)
@@ -3096,9 +3098,9 @@ function writeArtistPage(artist) {
track.contributors.find(({ who }) => who === artist)?.what
].filter(Boolean).join(', ')
}
- })), ['album'])
- .map(({album, chunk}) => ({
- album, chunk,
+ })), ['date', 'album'])
+ .map(({date, album, chunk}) => ({
+ date, album, chunk,
duration: getTotalDuration(chunk),
})));
@@ -3165,10 +3167,10 @@ function writeArtistPage(artist) {
const generateTrackList = (chunks, {strings, to}) => fixWS`
- ${chunks.map(({album, chunk, duration}) => fixWS`
+ ${chunks.map(({date, album, chunk, duration}) => fixWS`
- ${strings('artistPage.creditList.album.withDate.withDuration', {
album: strings.link.album(album, {to}),
- date: strings.count.date(album.date),
+ date: strings.count.date(date),
duration: strings.count.duration(duration, {approximate: true})
})}
@@ -3277,10 +3279,10 @@ function writeArtistPage(artist) {
})))
})}
- ${artListChunks.map(({album, chunk}) => fixWS`
+ ${artListChunks.map(({date, album, chunk}) => fixWS`
- ${strings('artistPage.creditList.album.withDate', {
album: strings.link.album(album, {to}),
- date: strings.count.date(album.date)
+ date: strings.count.date(date)
})}
${(chunk
--
cgit 1.3.0-6-gf8a5