diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-06-13 23:07:52 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-06-13 23:07:52 -0300 |
commit | e33d80f5704ab974f781bc97191d1e29a1ccc77e (patch) | |
tree | 2ca219cd1e70e0556d39a5cde311fc51fd2730d0 | |
parent | 7b61b2cbf5eca5f31ec227bdfc98fbf8f6ec9b6a (diff) |
group tracks with lyrics listing by album
...rather than track date, which made the layout do Weird Things on occasion
-rw-r--r-- | src/listing-spec.js | 7 |
1 files changed, 5 insertions, 2 deletions
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` <dl> - ${chunks.map(({album, chunk: tracks}) => fixWS` + ${chunks.map(({album, tracks}) => fixWS` <dt>${language.$('listingPage.listTracks.withLyrics.album', { album: link.album(album), date: language.formatDate(album.date) |