« get me outta code hell

group tracks with lyrics listing by album - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
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
commite33d80f5704ab974f781bc97191d1e29a1ccc77e (patch)
tree2ca219cd1e70e0556d39a5cde311fc51fd2730d0 /src
parent7b61b2cbf5eca5f31ec227bdfc98fbf8f6ec9b6a (diff)
group tracks with lyrics listing by album
...rather than track date, which made the layout do Weird Things
on occasion
Diffstat (limited to 'src')
-rw-r--r--src/listing-spec.js7
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)