« get me outta code hell

data, content: album additional names - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-09-30 21:37:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-09-30 21:37:38 -0300
commit3feae74688339ff37bbf6269c00363c132b1106f (patch)
tree95f99696e9662983b7d368d90f2ca9ac9a5fd1d1 /src
parentee7508da2a7f615636c8a10826db57a5e06fdafe (diff)
data, content: album additional names
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateAlbumInfoPage.js6
-rw-r--r--src/data/things/album.js18
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,