diff options
Diffstat (limited to 'src/content/dependencies/generateMusicVideo.js')
| -rw-r--r-- | src/content/dependencies/generateMusicVideo.js | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/content/dependencies/generateMusicVideo.js b/src/content/dependencies/generateMusicVideo.js index a61cd5b7..7f0108af 100644 --- a/src/content/dependencies/generateMusicVideo.js +++ b/src/content/dependencies/generateMusicVideo.js @@ -1,5 +1,5 @@ export default { - relations: (relation, musicVideo) => ({ + relations: (relation, musicVideo, thing) => ({ image: relation('image', { path: musicVideo.path, @@ -7,6 +7,9 @@ export default { dimensions: musicVideo.coverArtDimensions, }), + datetimestamp: + relation('generateAbsoluteDatetimestamp', musicVideo.date, thing.date), + artistCredit: relation('generateArtistCredit', musicVideo.artistContribs, []), @@ -14,7 +17,7 @@ export default { relation('generateArtistCredit', musicVideo.contributorContribs, []), }), - data: (musicVideo) => ({ + data: (musicVideo, _track) => ({ label: musicVideo.label, @@ -46,16 +49,25 @@ export default { [ language.encapsulate(capsule, 'by', workingCapsule => { - const additionalStringOptions = {}; + const workingOptions = {}; if (data.label) { workingCapsule += '.customLabel'; - additionalStringOptions.label = data.label; + workingOptions.label = data.label; + } + + const {datetimestamp} = relations; + + datetimestamp.setSlot('style', 'year-difference'); + + if (!html.isBlank(datetimestamp)) { + workingCapsule += '.withDate'; + workingOptions.date = datetimestamp; } return relations.artistCredit.slots({ normalStringKey: workingCapsule, - additionalStringOptions, + additionalStringOptions: workingOptions, showAnnotation: true, showChronology: true, |