« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite')
-rw-r--r--src/data/composite/things/album/withTrackSections.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/data/composite/things/album/withTrackSections.js b/src/data/composite/things/album/withTrackSections.js
index c99b94d2..baa3cb4a 100644
--- a/src/data/composite/things/album/withTrackSections.js
+++ b/src/data/composite/things/album/withTrackSections.js
@@ -41,6 +41,7 @@ export default templateCompositeFrom({
         'tracks',
         'dateOriginallyReleased',
         'isDefaultTrackSection',
+        'name',
         'color',
       ]),
     }),
@@ -56,6 +57,11 @@ export default templateCompositeFrom({
     }),
 
     fillMissingListItems({
+      list: '#sections.name',
+      fill: input.value('Unnamed Track Section'),
+    }),
+
+    fillMissingListItems({
       list: '#sections.color',
       fill: input.dependency('color'),
     }),
@@ -86,6 +92,7 @@ export default templateCompositeFrom({
     {
       dependencies: [
         '#sections.tracks',
+        '#sections.name',
         '#sections.color',
         '#sections.dateOriginallyReleased',
         '#sections.isDefaultTrackSection',
@@ -94,19 +101,21 @@ export default templateCompositeFrom({
 
       compute: (continuation, {
         '#sections.tracks': tracks,
+        '#sections.name': name,
         '#sections.color': color,
         '#sections.dateOriginallyReleased': dateOriginallyReleased,
         '#sections.isDefaultTrackSection': isDefaultTrackSection,
         '#sections.startIndex': startIndex,
       }) => {
         filterMultipleArrays(
-          tracks, color, dateOriginallyReleased, isDefaultTrackSection, startIndex,
+          tracks, name, color, dateOriginallyReleased, isDefaultTrackSection, startIndex,
           tracks => !empty(tracks));
 
         return continuation({
           ['#trackSections']:
             stitchArrays({
               tracks,
+              name,
               color,
               dateOriginallyReleased,
               isDefaultTrackSection,