diff options
Diffstat (limited to 'src/content/dependencies/generateReleaseInfoContributionsLine.js')
-rw-r--r-- | src/content/dependencies/generateReleaseInfoContributionsLine.js | 53 |
1 files changed, 21 insertions, 32 deletions
diff --git a/src/content/dependencies/generateReleaseInfoContributionsLine.js b/src/content/dependencies/generateReleaseInfoContributionsLine.js index 2e6c4709..016e0a2c 100644 --- a/src/content/dependencies/generateReleaseInfoContributionsLine.js +++ b/src/content/dependencies/generateReleaseInfoContributionsLine.js @@ -1,42 +1,31 @@ -import {empty} from '#sugar'; - export default { - contentDependencies: ['linkContribution'], - extraDependencies: ['html', 'language'], - - relations(relation, contributions) { - if (empty(contributions)) { - return {}; - } + contentDependencies: ['generateArtistCredit'], + extraDependencies: ['html'], - return { - contributionLinks: - contributions - .map(contrib => relation('linkContribution', contrib)), - }; - }, + relations: (relation, contributions) => ({ + credit: + relation('generateArtistCredit', contributions, []), + }), slots: { stringKey: {type: 'string'}, + featuringStringKey: {type: 'string'}, - showContribution: {type: 'boolean', default: true}, - showIcons: {type: 'boolean', default: true}, + chronologyKind: {type: 'string'}, }, - generate(relations, slots, {html, language}) { - if (!relations.contributionLinks) { - return html.blank(); - } + generate: (relations, slots) => + relations.credit.slots({ + showAnnotation: true, + showExternalLinks: true, + showChronology: true, + showWikiEdits: true, - return language.$(slots.stringKey, { - artists: - language.formatConjunctionList( - relations.contributionLinks.map(link => - link.slots({ - showContribution: slots.showContribution, - showIcons: slots.showIcons, - iconMode: 'tooltip', - }))), - }); - }, + trimAnnotation: false, + + chronologyKind: slots.chronologyKind, + + normalStringKey: slots.stringKey, + normalFeaturingStringKey: slots.featuringStringKey, + }), }; |