« get me outta code hell

data: withPropertiesFrom{Object,List} - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/album.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-09 08:47:38 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-09 08:47:38 -0300
commit7a21c665d888b0db4c47c72049f7649bf1dabcde (patch)
tree0f35daa330a9520c90866d2f5eaf1f45791a1be3 /src/data/things/album.js
parent726118e7e8eefa9002562ca2dd0a4f6deb8a05b9 (diff)
data: withPropertiesFrom{Object,List}
Diffstat (limited to 'src/data/things/album.js')
-rw-r--r--src/data/things/album.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 288caa04..e11d0909 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -10,7 +10,7 @@ import {
   exposeUpdateValueOrContinue,
   fillMissingListItems,
   withFlattenedArray,
-  withPropertyFromList,
+  withPropertiesFromList,
   withUnflattenedArray,
   withUpdateValueAsDependency,
 } from '#composite';
@@ -86,17 +86,22 @@ export class Album extends Thing {
 
       withUpdateValueAsDependency({into: '#sections'}),
 
-      withPropertyFromList({list: '#sections', property: 'tracks', into: '#sections.trackRefs'}),
-      withPropertyFromList({list: '#sections', property: 'dateOriginallyReleased'}),
-      withPropertyFromList({list: '#sections', property: 'isDefaultTrackSection'}),
-      withPropertyFromList({list: '#sections', property: 'color'}),
+      withPropertiesFromList({
+        list: '#sections',
+        properties: [
+          'tracks',
+          'dateOriginallyReleased',
+          'isDefaultTrackSection',
+          'color',
+        ],
+      }),
 
-      fillMissingListItems({list: '#sections.trackRefs', value: []}),
+      fillMissingListItems({list: '#sections.tracks', value: []}),
       fillMissingListItems({list: '#sections.isDefaultTrackSection', value: false}),
       fillMissingListItems({list: '#sections.color', dependency: 'color'}),
 
       withFlattenedArray({
-        from: '#sections.trackRefs',
+        from: '#sections.tracks',
         into: '#trackRefs',
         intoIndices: '#sections.startIndex',
       }),