« get me outta code hell

data: series list showAlbumArtists - 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-10-18 08:54:50 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-11-02 22:12:50 -0300
commit8e5c0d5f858716ce6029e47afdde9ded79ed8e32 (patch)
tree7187aca9a0e6a6d50ee53617f930c69eaa0bd48d /src
parent8fa2a306dbd74accf77028669b3a1e69f6bbeafc (diff)
data: series list showAlbumArtists
Diffstat (limited to 'src')
-rw-r--r--src/data/composite/wiki-data/withResolvedSeriesList.js13
-rw-r--r--src/data/validators.js2
-rw-r--r--src/data/yaml.js2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/data/composite/wiki-data/withResolvedSeriesList.js b/src/data/composite/wiki-data/withResolvedSeriesList.js
index bd2b0ecf..4ac74cc3 100644
--- a/src/data/composite/wiki-data/withResolvedSeriesList.js
+++ b/src/data/composite/wiki-data/withResolvedSeriesList.js
@@ -46,6 +46,8 @@ export default templateCompositeFrom({
         'name',
         'description',
         'albums',
+
+        'showAlbumArtists',
       ]),
     }),
 
@@ -76,23 +78,34 @@ export default templateCompositeFrom({
       fill: input.value(null),
     }),
 
+    fillMissingListItems({
+      list: '#serieses.showAlbumArtists',
+      fill: input.value(null),
+    }),
+
     {
       dependencies: [
         '#serieses.name',
         '#serieses.description',
         '#serieses.albums',
+
+        '#serieses.showAlbumArtists',
       ],
 
       compute: (continuation, {
         ['#serieses.name']: name,
         ['#serieses.description']: description,
         ['#serieses.albums']: albums,
+
+        ['#serieses.showAlbumArtists']: showAlbumArtists,
       }) => continuation({
         ['#seriesProperties']:
           stitchArrays({
             name,
             description,
             albums,
+
+            showAlbumArtists,
           }).map(properties => ({
               ...properties,
               group: input
diff --git a/src/data/validators.js b/src/data/validators.js
index dfb20ff0..39559cfa 100644
--- a/src/data/validators.js
+++ b/src/data/validators.js
@@ -717,6 +717,8 @@ export const isSeries = validateProperties({
   name: isName,
   description: optional(isContentString),
   albums: optional(validateReferenceList('album')),
+
+  showAlbumArtists: optional(isBoolean),
 });
 
 export const isSeriesList = validateArrayItems(isSeries);
diff --git a/src/data/yaml.js b/src/data/yaml.js
index f5394752..3f79aa65 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -473,6 +473,8 @@ export function parseSerieses(entries) {
       name: item['Name'],
       description: item['Description'] ?? null,
       albums: item['Albums'] ?? null,
+
+      showAlbumArtists: item['Show Album Artists'] ?? null,
     };
   });
 }