« get me outta code hell

change tracks/by-date sorting algorithm - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-15 16:00:03 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-01-15 16:01:26 -0400
commit2f129a9ca167c5fecf303234c7e2bb5ea347f1c2 (patch)
tree899ee7940fb2bb170d35aaf31082091cdce32e79
parent2803b20313cc4c3aa008bdbcd3abd407405ce91f (diff)
change tracks/by-date sorting algorithm
-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 636e5f67..05abbd05 100644
--- a/src/listing-spec.js
+++ b/src/listing-spec.js
@@ -615,9 +615,12 @@ const listingSpec = [
     directory: 'tracks/by-date',
     stringsKey: 'listTracks.byDate',
 
-    data: ({wikiData: {trackData}}) =>
+    data: ({wikiData: {albumData}}) =>
       chunkByProperties(
-        sortChronologically(trackData.filter(t => t.date)),
+        sortByDate(
+          sortChronologically(albumData)
+            .flatMap(album => album.tracks)
+            .filter(track => track.date)),
         ['album', 'date']),
 
     html: (data, {html, language, link}) =>