From 3feae74688339ff37bbf6269c00363c132b1106f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 30 Sep 2024 21:37:38 -0300 Subject: data, content: album additional names --- src/content/dependencies/generateAlbumInfoPage.js | 6 ++++++ src/data/things/album.js | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/content/dependencies/generateAlbumInfoPage.js b/src/content/dependencies/generateAlbumInfoPage.js index 5af3c1d6..22c6edcb 100644 --- a/src/content/dependencies/generateAlbumInfoPage.js +++ b/src/content/dependencies/generateAlbumInfoPage.js @@ -1,5 +1,6 @@ export default { contentDependencies: [ + 'generateAdditionalNamesBox', 'generateAlbumAdditionalFilesList', 'generateAlbumBanner', 'generateAlbumCoverArtwork', @@ -38,6 +39,9 @@ export default { sidebar: relation('generateAlbumSidebar', album, null), + additionalNamesBox: + relation('generateAdditionalNamesBox', album.additionalNames), + cover: (album.hasCoverArt ? relation('generateAlbumCoverArtwork', album) @@ -102,6 +106,8 @@ export default { headingMode: 'sticky', styleRules: [relations.albumStyleRules], + additionalNames: relations.additionalNamesBox, + cover: relations.cover ?.slots({ diff --git a/src/data/things/album.js b/src/data/things/album.js index 82f155b4..e17304d0 100644 --- a/src/data/things/album.js +++ b/src/data/things/album.js @@ -12,8 +12,14 @@ import {sortAlbumsTracksChronologically, sortChronologically} from '#sort'; import {accumulateSum, empty} from '#sugar'; import Thing from '#thing'; import {isColor, isDate, validateWikiData} from '#validators'; -import {parseAdditionalFiles, parseContributors, parseDate, parseDimensions} - from '#yaml'; + +import { + parseAdditionalFiles, + parseAdditionalNames, + parseContributors, + parseDate, + parseDimensions, +} from '#yaml'; import {exitWithoutDependency, exposeDependency, exposeUpdateValueOrContinue} from '#composite/control-flow'; @@ -28,6 +34,7 @@ import { import { additionalFiles, + additionalNameList, commentary, color, commentatorArtists, @@ -72,6 +79,8 @@ export class Album extends Thing { alwaysReferenceTracksByDirectory: flag(false), + additionalNames: additionalNameList(), + bandcampAlbumIdentifier: simpleString(), bandcampArtworkIdentifier: simpleString(), @@ -296,6 +305,11 @@ export class Album extends Thing { property: 'alwaysReferenceTracksByDirectory', }, + 'Additional Names': { + property: 'additionalNames', + transform: parseAdditionalNames, + }, + 'Bandcamp Album ID': { property: 'bandcampAlbumIdentifier', transform: String, -- cgit 1.3.0-6-gf8a5