From a0381a363e0ee05d2aa78316b5a910ac749fc101 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 17 Jan 2026 05:06:34 -0400 Subject: content: generateMusicVideoReleaseLine: wrap "by" nicely --- src/content/dependencies/generateMusicVideo.js | 52 ++++++++------------------ 1 file changed, 16 insertions(+), 36 deletions(-) (limited to 'src/content/dependencies/generateMusicVideo.js') 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', + }), + })), ]), ])), }; -- cgit 1.3.0-6-gf8a5