From 28232be4352a3b67e8c60df294c9686ad9160640 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 1 Feb 2026 00:08:53 -0400 Subject: content: generateMusicVideoArtistsLine: proper dynamics --- .../dependencies/generateMusicVideoArtistsLine.js | 46 ++++++++++++++-------- 1 file changed, 29 insertions(+), 17 deletions(-) (limited to 'src/content/dependencies') diff --git a/src/content/dependencies/generateMusicVideoArtistsLine.js b/src/content/dependencies/generateMusicVideoArtistsLine.js index f79fdc8c..54114387 100644 --- a/src/content/dependencies/generateMusicVideoArtistsLine.js +++ b/src/content/dependencies/generateMusicVideoArtistsLine.js @@ -6,34 +6,46 @@ export default { data: (musicVideo) => ({ label: - (musicVideo.label !== 'Music video' - ? musicVideo.label - : null), + musicVideo.label, }), generate: (data, relations, {html, language}) => language.encapsulate('misc.musicVideo.artistsLine', artistsLineCapsule => language.encapsulate(artistsLineCapsule, workingCapsule => { - const workingOptions = {[language.onlyIfOptions]: ['credit']}; + const credit = relations.artistCredit; - if (data.label) { - workingCapsule += '.customLabel'; - workingOptions.label = data.label; + credit.setSlots({ + normalStringKey: + language.encapsulate(artistsLineCapsule, 'credit'), + + showAnnotation: true, + showChronology: true, + + chronologyKind: 'musicVideo', + }); + + if (html.isBlank(credit)) { + return html.blank(); } - workingOptions.credit = - html.tag('span', {class: 'by'}, - {[html.onlyIfContent]: true}, + if (data.label === 'Music video' || !data.label) { + credit.setSlots({ + normalStringKey: + language.encapsulate(artistsLineCapsule, 'noLabel'), + }); - relations.artistCredit.slots({ - normalStringKey: - language.encapsulate(artistsLineCapsule, 'credit'), + return credit; + } + + const workingOptions = {}; - showAnnotation: true, - showChronology: true, + workingOptions.credit = + html.tag('span', {class: 'by'}, credit); - chronologyKind: 'musicVideo', - })); + if (data.label && data.label !== 'Music video') { + workingCapsule += '.customLabel'; + workingOptions.label = data.label; + } return language.$(workingCapsule, workingOptions); })), -- cgit 1.3.0-6-gf8a5