« get me outta code hell

content: generateMusicVideoReleaseLine: wrap "by" nicely - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateMusicVideo.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-01-17 05:06:34 -0400
committer(quasar) nebula <qznebula@protonmail.com>2026-01-17 05:06:34 -0400
commita0381a363e0ee05d2aa78316b5a910ac749fc101 (patch)
tree2c336c5e6d38de1d97add9b9e7ba9a3690afe62f /src/content/dependencies/generateMusicVideo.js
parentda43a2365d18216a6fc54f073b7ec85cc4e7dafc (diff)
content: generateMusicVideoReleaseLine: wrap "by" nicely
Diffstat (limited to 'src/content/dependencies/generateMusicVideo.js')
-rw-r--r--src/content/dependencies/generateMusicVideo.js52
1 files changed, 16 insertions, 36 deletions
diff --git a/src/content/dependencies/generateMusicVideo.js b/src/content/dependencies/generateMusicVideo.js
index 7f0108af..e83fdf80 100644
--- a/src/content/dependencies/generateMusicVideo.js
+++ b/src/content/dependencies/generateMusicVideo.js
@@ -7,11 +7,8 @@ export default {
         dimensions: musicVideo.coverArtDimensions,
       }),
 
-    datetimestamp:
-      relation('generateAbsoluteDatetimestamp', musicVideo.date, thing.date),
-
-    artistCredit:
-      relation('generateArtistCredit', musicVideo.artistContribs, []),
+    releaseLine:
+      relation('generateMusicVideoReleaseLine', musicVideo, thing),
 
     contributorCredit:
       relation('generateArtistCredit', musicVideo.contributorContribs, []),
@@ -48,42 +45,25 @@ export default {
           {[html.joinChildren]: html.tag('br')},
 
           [
-            language.encapsulate(capsule, 'by', workingCapsule => {
-              const workingOptions = {};
-
-              if (data.label) {
-                workingCapsule += '.customLabel';
-                workingOptions.label = data.label;
-              }
-
-              const {datetimestamp} = relations;
-
-              datetimestamp.setSlot('style', 'year-difference');
-
-              if (!html.isBlank(datetimestamp)) {
-                workingCapsule += '.withDate';
-                workingOptions.date = datetimestamp;
-              }
-
-              return relations.artistCredit.slots({
-                normalStringKey: workingCapsule,
-                additionalStringOptions: workingOptions,
+            html.tag('span', {class: 'release-line'},
+              {[html.onlyIfContent]: true},
 
-                showAnnotation: true,
-                showChronology: true,
+              relations.releaseLine),
 
-                chronologyKind: 'musicVideo',
-              });
-            }),
+            language.encapsulate(capsule, 'contributorsLine', capsule =>
+              language.$(capsule, {
+                [language.onlyIfOptions]: ['credit'],
 
-            relations.contributorCredit.slots({
-              normalStringKey: language.encapsulate(capsule, 'contributors'),
+                credit:
+                  relations.contributorCredit.slots({
+                    normalStringKey: language.encapsulate(capsule, 'credit'),
 
-              showAnnotation: true,
-              showChronology: true,
+                    showAnnotation: true,
+                    showChronology: true,
 
-              chronologyKind: 'musicVideoContribution',
-            }),
+                    chronologyKind: 'musicVideoContribution',
+                  }),
+              })),
           ]),
       ])),
 };