« get me outta code hell

content: generateTrackInfoPage: simpler forward ref list layout - 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-06-12 13:17:57 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:08 -0300
commit05395c680263e3254fdd91de78163abb963e72a4 (patch)
tree75569c7cd05af4c13286842a559eba5fba86cafb /src
parent79ac807130a48578cf32b1b2258c481121a1c7c7 (diff)
content: generateTrackInfoPage: simpler forward ref list layout
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateTrackInfoPage.js32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/content/dependencies/generateTrackInfoPage.js b/src/content/dependencies/generateTrackInfoPage.js
index c8037e2c..2ee1ba61 100644
--- a/src/content/dependencies/generateTrackInfoPage.js
+++ b/src/content/dependencies/generateTrackInfoPage.js
@@ -107,21 +107,13 @@ export default {
 
     // Section: Referenced tracks
 
-    if (!empty(track.referencedTracks)) {
-      const references = sections.references = {};
-
-      references.list =
-        relation('generateTrackList', track.referencedTracks);
-    }
+    relations.referencedTracksList =
+      relation('generateTrackList', track.referencedTracks);
 
     // Section: Sampled tracks
 
-    if (!empty(track.sampledTracks)) {
-      const samples = sections.samples = {};
-
-      samples.list =
-        relation('generateTrackList', track.sampledTracks);
-    }
+    relations.sampledTracksList =
+      relation('generateTrackList', track.sampledTracks);
 
     // Section: Tracks that reference
 
@@ -279,7 +271,7 @@ export default {
                 }),
             ]),
 
-          relations.otherReleasesList && [
+          html.tags([
             relations.contentHeading.clone()
               .slots({
                 attributes: {id: 'also-released-as'},
@@ -287,7 +279,7 @@ export default {
               }),
 
             relations.otherReleasesList,
-          ],
+          ]),
 
           sec.contributors && [
             relations.contentHeading.clone()
@@ -299,7 +291,7 @@ export default {
             sec.contributors.list,
           ],
 
-          sec.references && [
+          html.tags([
             relations.contentHeading.clone()
               .slots({
                 attributes: {id: 'references'},
@@ -313,10 +305,10 @@ export default {
                   language.$('releaseInfo.tracksReferenced.sticky'),
               }),
 
-            sec.references.list,
-          ],
+            relations.referencedTracksList,
+          ]),
 
-          sec.samples && [
+          html.tags([
             relations.contentHeading.clone()
               .slots({
                 attributes: {id: 'samples'},
@@ -330,8 +322,8 @@ export default {
                   language.$('releaseInfo.tracksSampled.sticky'),
               }),
 
-            sec.samples.list,
-          ],
+            relations.sampledTracksList,
+          ]),
 
           sec.referencedBy && [
             relations.contentHeading.clone()