diff options
Diffstat (limited to 'upd8.js')
-rwxr-xr-x | upd8.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/upd8.js b/upd8.js index 732c35a1..66582f17 100755 --- a/upd8.js +++ b/upd8.js @@ -4136,6 +4136,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` + <dl> + ${chunks.map(({dateAdded, chunk: albums}) => fixWS` + <dt>${strings('listingPage.listAlbums.byDateAdded.date', { + date: strings.count.date(dateAdded) + })}</dt> + <dd><ul> + ${(albums + .map(album => strings('listingPage.listAlbums.byDateAdded.album', { + album: strings.link.album(album, {to}) + })) + .map(row => `<li>${row}</li>`) + .join('\n'))} + </ul></dd> + `).join('\n')} + </dl> + `; + } + }, + + { directory: 'artists/by-name', title: ({strings}) => strings('listingPage.listArtists.byName.title'), |