diff options
Diffstat (limited to 'src/content/dependencies/generateMusicVideoArtistsLine.js')
| -rw-r--r-- | src/content/dependencies/generateMusicVideoArtistsLine.js | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/content/dependencies/generateMusicVideoArtistsLine.js b/src/content/dependencies/generateMusicVideoArtistsLine.js index 959d3648..f79fdc8c 100644 --- a/src/content/dependencies/generateMusicVideoArtistsLine.js +++ b/src/content/dependencies/generateMusicVideoArtistsLine.js @@ -11,31 +11,30 @@ export default { : null), }), - generate(data, relations, {html, language}) { - const {artistCredit} = relations; - const capsule = language.encapsulate('misc.musicVideo'); + generate: (data, relations, {html, language}) => + language.encapsulate('misc.musicVideo.artistsLine', artistsLineCapsule => + language.encapsulate(artistsLineCapsule, workingCapsule => { + const workingOptions = {[language.onlyIfOptions]: ['credit']}; - let artistsLineCapsule = language.encapsulate(capsule, 'artistsLine'); - let artistsLineOptions = {[language.onlyIfOptions]: ['credit']}; + if (data.label) { + workingCapsule += '.customLabel'; + workingOptions.label = data.label; + } - if (data.label) { - artistsLineCapsule += '.customLabel'; - artistsLineOptions.label = data.label; - } + workingOptions.credit = + html.tag('span', {class: 'by'}, + {[html.onlyIfContent]: true}, - artistsLineOptions.credit = - html.tag('span', {class: 'by'}, - {[html.onlyIfContent]: true}, + relations.artistCredit.slots({ + normalStringKey: + language.encapsulate(artistsLineCapsule, 'credit'), - artistCredit.slots({ - normalStringKey: language.encapsulate(capsule, 'artistsLine.credit'), + showAnnotation: true, + showChronology: true, - showAnnotation: true, - showChronology: true, + chronologyKind: 'musicVideo', + })); - chronologyKind: 'musicVideo', - })); - - return language.$(artistsLineCapsule, artistsLineOptions); - }, -} + return language.$(workingCapsule, workingOptions); + })), +}; |