« get me outta code hell

content: generateAlbumTrackList: handle zero-duration section titles - 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>2024-02-06 21:50:07 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-02-10 13:31:05 -0400
commit4dcd5323fafd6f1de18568a043312aef4908ef8c (patch)
tree1933ba49e528a97b310019c808da3c7d32eb3e0f /src
parenteb9d8d8d71debaad39e93c873b4fa0f86431c59e (diff)
content: generateAlbumTrackList: handle zero-duration section titles
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateAlbumTrackList.js18
-rw-r--r--src/strings-default.yaml1
2 files changed, 12 insertions, 7 deletions
diff --git a/src/content/dependencies/generateAlbumTrackList.js b/src/content/dependencies/generateAlbumTrackList.js
index 3186306a..089f6e30 100644
--- a/src/content/dependencies/generateAlbumTrackList.js
+++ b/src/content/dependencies/generateAlbumTrackList.js
@@ -134,13 +134,17 @@ export default {
               heading.slots({
                 tag: 'dt',
                 title:
-                  language.$('trackList.section.withDuration', {
-                    section: name,
-                    duration:
-                      language.formatDuration(duration, {
-                        approximate: durationApproximate,
-                      }),
-                  }),
+                  (duration === 0
+                    ? language.$('trackList.section', {
+                        section: name,
+                      })
+                    : language.$('trackList.section.withDuration', {
+                        section: name,
+                        duration:
+                          language.formatDuration(duration, {
+                            approximate: durationApproximate,
+                          }),
+                      })),
               }),
 
               html.tag('dd',
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index 53598e38..d274d75b 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -360,6 +360,7 @@ releaseInfo:
 #
 trackList:
   section:
+    _: "{SECTION}:"
     withDuration: "{SECTION}: ({DURATION})"
 
   group: