diff --git a/src/content/dependencies/generateContributionTooltipChronologySection.js b/src/content/dependencies/generateContributionTooltipChronologySection.js index 78c9051c..2b8ef48e 100644 --- a/src/content/dependencies/generateContributionTooltipChronologySection.js +++ b/src/content/dependencies/generateContributionTooltipChronologySection.js @@ -41,18 +41,7 @@ export default { }), slots: { - kind: { - validate: v => - v.is( - 'album', - 'bannerArt', - 'coverArt', - 'flash', - 'track', - 'trackArt', - 'trackContribution', - 'wallpaperArt'), - }, + kind: {type: 'string'}, }, generate: (data, relations, slots, {html, language}) => diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js index a895fe9a..eb9a43ba 100644 --- a/src/content/dependencies/generatePageLayout.js +++ b/src/content/dependencies/generatePageLayout.js @@ -518,6 +518,9 @@ export default { {id: 'art', string: 'artworks'}, {id: 'flashes', string: 'flashes'}, {id: 'contributors', string: 'contributors'}, + {id: 'writing-contributors', string: 'writingContributors'}, + {id: 'performing-contributors', string: 'performingContributors'}, + {id: 'engineering-contributors', string: 'engineeringContributors'}, {id: 'references', string: 'references'}, {id: 'referenced-by', string: 'referencedBy'}, {id: 'samples', string: 'samples'}, diff --git a/src/content/dependencies/generateTrackInfoPage.js b/src/content/dependencies/generateTrackInfoPage.js index 39f2a437..cfc122ad 100644 --- a/src/content/dependencies/generateTrackInfoPage.js +++ b/src/content/dependencies/generateTrackInfoPage.js @@ -72,6 +72,15 @@ export default { contributorContributionList: relation('generateContributionList', track.contributorContribs), + writingContributionList: + relation('generateContributionList', track.writingContributions), + + performingContributionList: + relation('generateContributionList', track.performingContributions), + + engineeringContributionList: + relation('generateContributionList', track.engineeringContributions), + referencedTracksList: relation('generateTrackList', track.referencedTracks), @@ -209,6 +218,42 @@ export default { relations.otherReleasesList, ]), + html.tags([ + relations.contentHeading.clone() + .slots({ + attributes: {id: 'writing-contributors'}, + title: language.$('releaseInfo.writingContributors'), + }), + + relations.writingContributionList.slots({ + chronologyKind: 'writingContribution', + }), + ]), + + html.tags([ + relations.contentHeading.clone() + .slots({ + attributes: {id: 'performing-contributors'}, + title: language.$('releaseInfo.performingContributors'), + }), + + relations.performingContributionList.slots({ + chronologyKind: 'performingContribution', + }), + ]), + + html.tags([ + relations.contentHeading.clone() + .slots({ + attributes: {id: 'engineering-contributors'}, + title: language.$('releaseInfo.engineeringContributors'), + }), + + relations.engineeringContributionList.slots({ + chronologyKind: 'engineeringContribution', + }), + ]), + html.tags([ relations.contentHeading.clone() .slots({ diff --git a/src/data/composite/things/track/exitIfRerelease.js b/src/data/composite/things/track/exitIfRerelease.js new file mode 100644 index 00000000..4422899f --- /dev/null +++ b/src/data/composite/things/track/exitIfRerelease.js @@ -0,0 +1,42 @@ +// Shorthand for checking if the track is a rerelease and exposing a value +// if it is. + +import {input, templateCompositeFrom} from '#composite'; + +import {withResultOfAvailabilityCheck} from '#composite/control-flow'; + +import withOriginalRelease from './withOriginalRelease.js'; + +export default templateCompositeFrom({ + annotation: `exitWithoutUniqueCoverArt`, + + inputs: { + value: input({defaultValue: null}), + }, + + steps: () => [ + withOriginalRelease(), + + withResultOfAvailabilityCheck({ + from: '#originalRelease', + }), + + { + dependencies: ['#availability'], + compute: (continuation, { + ['#availability']: availability, + }) => + (availability + ? continuation() + : continuation.raiseOutput()), + }, + + { + dependencies: [input('value')], + compute: (continuation, { + [input('value')]: value, + }) => + continuation.exit(value), + }, + ], +}); diff --git a/src/data/composite/things/track/index.js b/src/data/composite/things/track/index.js index 05ccaaba..510f5281 100644 --- a/src/data/composite/things/track/index.js +++ b/src/data/composite/things/track/index.js @@ -1,3 +1,4 @@ +export {default as exitIfRerelease} from './exitIfRerelease.js'; export {default as exitWithoutUniqueCoverArt} from './exitWithoutUniqueCoverArt.js'; export {default as inheritContributionListFromOriginalRelease} from './inheritContributionListFromOriginalRelease.js'; export {default as inheritFromOriginalRelease} from './inheritFromOriginalRelease.js'; diff --git a/src/data/things/artist.js b/src/data/things/artist.js index c6ee222a..a3aac5f2 100644 --- a/src/data/things/artist.js +++ b/src/data/things/artist.js @@ -100,6 +100,21 @@ export class Artist extends Thing { list: input.value('coverArtistContribs'), }), + trackWritingContributions: reverseContributionList({ + data: 'trackData', + list: input.value('writingContributions'), + }), + + trackPerformingContributions: reverseContributionList({ + data: 'trackData', + list: input.value('performingContributions'), + }), + + trackEngineeringContributions: reverseContributionList({ + data: 'trackData', + list: input.value('engineeringContributions'), + }), + tracksAsCommentator: reverseReferenceList({ data: 'trackData', list: input.value('commentatorArtists'), diff --git a/src/data/things/track.js b/src/data/things/track.js index 408f18fb..cef2512b 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -60,6 +60,7 @@ import { } from '#composite/wiki-properties'; import { + exitIfRerelease, exitWithoutUniqueCoverArt, inheritContributionListFromOriginalRelease, inheritFromOriginalRelease, @@ -264,8 +265,6 @@ export class Track extends Thing { ], contributorContribs: [ - inheritContributionListFromOriginalRelease(), - withDate(), contributionList({ @@ -274,6 +273,41 @@ export class Track extends Thing { }), ], + writingContributions: [ + exitIfRerelease({ + value: input.value([]), + }), + + withDate(), + + contributionList({ + date: '#date', + artistProperty: input.value('trackWritingContributions'), + }), + ], + + performingContributions: [ + exitIfRerelease({ + value: input.value([]), + }), + + withDate(), + + contributionList({ + date: '#date', + artistProperty: input.value('performingContributions'), + }), + ], + + engineeringContributions: [ + withDate(), + + contributionList({ + date: '#date', + artistProperty: input.value('engineeringContributions'), + }), + ], + // Cover artists aren't inherited from the original release, since it // typically varies by release and isn't defined by the musical qualities // of the track. @@ -551,6 +585,21 @@ export class Track extends Thing { transform: parseContributors, }, + 'Writing Contributors': { + property: 'writingContributions', + transform: parseContributors, + }, + + 'Performing Contributors': { + property: 'performingContributions', + transform: parseContributors, + }, + + 'Engineering Contributors': { + property: 'engineeringContributions', + transform: parseContributors, + }, + 'Cover Artists': { property: 'coverArtistContribs', transform: parseContributors, @@ -577,9 +626,14 @@ export class Track extends Thing { 'Artists', ]}, - {message: `Rereleases inherit contributors from the original`, fields: [ + {message: `Rereleases don't have writing contributors`, fields: [ + 'Originally Released As', + 'Writing Contributors', + ]}, + + {message: `Rereleases don't have performing contributors`, fields: [ 'Originally Released As', - 'Contributors', + 'Performing Contributors', ]}, {message: `Rereleases inherit lyrics from the original`, fields: [ diff --git a/src/strings-default.yaml b/src/strings-default.yaml index af9f5895..3ec23ea7 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -265,8 +265,13 @@ releaseInfo: duration: "Duration: {DURATION}." - contributors: "Contributors:" + contributors: "General contributors:" + writingContributors: "Writing contributors:" + performingContributors: "Performing contributors:" + engineeringContributors: "Engineering contributors:" + lyrics: "Lyrics:" + note: "Context notes:" alsoReleasedAs: @@ -544,11 +549,14 @@ misc: album: "album" bannerArt: "banner art" coverArt: "cover art" + engineeringContribution: "engineering contribution" flash: "flash" + performingContribution: "performing contribution" track: "track" trackArt: "track art" - trackContribution: "track contribution" + trackContribution: "general contribution" wallpaperArt: "wallpaper art" + writingContribution: "writing contribution" # chronology: # @@ -821,10 +829,14 @@ misc: # Displayed on track and flash info pages. - contributors: "Contributors" + contributors: "General contributors" # Displayed on track info page. + writingContributors: "Writing contributors" + performingContributors: "Performing contributors" + engineeringContributors: "Engineering contributors" + references: "References..." referencedBy: "Referenced by..." samples: "Samples..."