« get me outta code hell

content: listTracksWithExtra: handle dateless albums cleanly - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-19 12:41:20 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-19 12:41:20 -0300
commit2099c258fc1833ac459c8a43ca0cae9ae6150ad0 (patch)
tree5e72d010774dd7542535e4c8e62ddf070df28545 /src/content
parentfcb00a7afd8c70586d645a7072fc84fa5de074b3 (diff)
content: listTracksWithExtra: handle dateless albums cleanly
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/listTracksWithExtra.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/content/dependencies/listTracksWithExtra.js b/src/content/dependencies/listTracksWithExtra.js
index 73d25e3d..c9f80f35 100644
--- a/src/content/dependencies/listTracksWithExtra.js
+++ b/src/content/dependencies/listTracksWithExtra.js
@@ -65,10 +65,14 @@ export default {
         stitchArrays({
           albumLink: relations.albumLinks,
           date: data.dates,
-        }).map(({albumLink, date}) => ({
-            album: albumLink,
-            date: language.formatDate(date),
-          })),
+        }).map(({albumLink, date}) =>
+            (date
+              ? {
+                  stringsKey: 'withDate',
+                  album: albumLink,
+                  date: language.formatDate(date),
+                }
+              : {album: albumLink})),
 
       chunkRows:
         relations.trackLinks