From b4097b4c12049814a8e350a469972bbe9addd8a6 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 20 Oct 2024 19:27:03 -0300 Subject: content: generateArtistCredit: fix mis-shown featuring annotation --- src/content/dependencies/generateArtistCredit.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/content/dependencies') diff --git a/src/content/dependencies/generateArtistCredit.js b/src/content/dependencies/generateArtistCredit.js index 196b5f32..72d55854 100644 --- a/src/content/dependencies/generateArtistCredit.js +++ b/src/content/dependencies/generateArtistCredit.js @@ -33,7 +33,10 @@ export default { const contextNormalContributions = contextContributions.filter(normalFilter); - query.normalContributionsAreDifferent = + // Note that the normal contributions will implicitly *always* + // "differ from context" if no context contributions are given, + // as in release info lines. + query.normalContributionsDifferFromContext = !compareArrays( query.normalContributions.map(({artist}) => artist), contextNormalContributions.map(({artist}) => artist), @@ -57,8 +60,8 @@ export default { }), data: (query, _creditContributions, _contextContributions) => ({ - normalContributionsAreDifferent: - query.normalContributionsAreDifferent, + normalContributionsDifferFromContext: + query.normalContributionsDifferFromContext, hasWikiEdits: !empty(query.wikiEditContributions), @@ -111,7 +114,7 @@ export default { for (const link of relations.featuringContributionLinks) { link.setSlots({ showAnnotation: - (slots.featuringStringKey + (slots.featuringStringKey || slots.normalFeaturingStringKey ? false : slots.showAnnotation), }); @@ -144,14 +147,14 @@ export default { ]); if (empty(relations.featuringContributionLinks)) { - if (data.normalContributionsAreDifferent) { + if (data.normalContributionsDifferFromContext) { return language.$(slots.normalStringKey, {artists: artistsList}); } else { return html.blank(); } } - if (data.normalContributionsAreDifferent && slots.normalFeaturingStringKey) { + if (data.normalContributionsDifferFromContext && slots.normalFeaturingStringKey) { return language.$(slots.normalFeaturingStringKey, { artists: artistsList, featuring: featuringList, -- cgit 1.3.0-6-gf8a5