From 27d366fd2de98d816ef0698a1a6d5b4d59b388ca Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 5 May 2022 19:36:59 -0300 Subject: support albums and tracks without release dates --- src/page/album.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/page/album.js') diff --git a/src/page/album.js b/src/page/album.js index eac0a9f..66d4bfa 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -168,7 +168,7 @@ export function write(album, {wikiData}) { showIcons: true }) }), - strings('releaseInfo.released', { + album.date && strings('releaseInfo.released', { date: strings.count.date(album.date) }), (album.coverArtDate && @@ -328,9 +328,10 @@ export function generateAlbumSidebar(album, currentTrack, { const { groups } = album; const groupParts = groups.map(group => { - const index = group.albums.indexOf(album); - const next = group.albums[index + 1]; - const previous = group.albums[index - 1]; + const albums = group.albums.filter(album => album.date); + const index = albums.indexOf(album); + const next = index >= 0 && albums[index + 1]; + const previous = index > 0 && albums[index - 1]; return {group, next, previous}; }).map(({group, next, previous}) => fixWS`

${ -- cgit 1.3.0-6-gf8a5