From e33d80f5704ab974f781bc97191d1e29a1ccc77e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 13 Jun 2022 23:07:52 -0300 Subject: group tracks with lyrics listing by album ...rather than track date, which made the layout do Weird Things on occasion --- src/listing-spec.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/listing-spec.js b/src/listing-spec.js index 497f9845..df2b038e 100644 --- a/src/listing-spec.js +++ b/src/listing-spec.js @@ -687,13 +687,16 @@ const listingSpec = [ stringsKey: 'listTracks.withLyrics', data({wikiData}) { - return chunkByProperties(wikiData.trackData.filter(t => t.lyrics), ['album']); + return wikiData.albumData.map(album => ({ + album, + tracks: album.tracks.filter(t => t.lyrics) + })).filter(({ tracks }) => tracks.length > 0); }, html(chunks, {link, language}) { return fixWS`
- ${chunks.map(({album, chunk: tracks}) => fixWS` + ${chunks.map(({album, tracks}) => fixWS`
${language.$('listingPage.listTracks.withLyrics.album', { album: link.album(album), date: language.formatDate(album.date) -- cgit 1.3.0-6-gf8a5