From 0d0d38ce51ca02b7c3bd91317b5fa0bbff1f06de Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 10 Apr 2021 22:28:17 -0300 Subject: new Albums - by Date Added to Wiki listing --- upd8.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'upd8.js') diff --git a/upd8.js b/upd8.js index 732c35a..66582f1 100755 --- a/upd8.js +++ b/upd8.js @@ -4135,6 +4135,38 @@ const listingSpec = [ } }, + { + directory: 'albusm/by-date-added', + title: ({strings}) => strings('listingPage.listAlbums.byDateAdded.title'), + + data() { + return chunkByProperties(albumData.slice().sort((a, b) => { + if (a.dateAdded < b.dateAdded) return -1; + if (a.dateAdded > b.dateAdded) return 1; + }), ['dateAdded']); + }, + + html(chunks, {strings, to}) { + return fixWS` +
+ ${chunks.map(({dateAdded, chunk: albums}) => fixWS` +
${strings('listingPage.listAlbums.byDateAdded.date', { + date: strings.count.date(dateAdded) + })}
+
    + ${(albums + .map(album => strings('listingPage.listAlbums.byDateAdded.album', { + album: strings.link.album(album, {to}) + })) + .map(row => `
  • ${row}
  • `) + .join('\n'))} +
+ `).join('\n')} +
+ `; + } + }, + { directory: 'artists/by-name', title: ({strings}) => strings('listingPage.listArtists.byName.title'), -- cgit 1.3.0-6-gf8a5