« 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/content/dependencies/generateTrackInfoPage.js
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-12 17:32:56 -0300
commit606fae021230dccf4686f60b2fd1c9dd8cc1b00d (patch)
treef5e5dcfb02c159cf40096a42d7c4f0813d25046c /src/content/dependencies/generateTrackInfoPage.js
parent2fd2c62a731062ccca8b733dd219b6b93000b550 (diff)
content: generateTrackInfoPage: simpler forward ref list layout
Diffstat (limited to 'src/content/dependencies/generateTrackInfoPage.js')
-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()