« get me outta code hell

data: restore withTrackSections, but simpler now - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-20 11:20:17 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-20 11:20:17 -0300
commit2383ce6c48e499e486e8ede66621af11af237c46 (patch)
treef5c26a35c3d624457f4cffce4ac8c6af17ef823d /src/data/composite/things
parent049f84a55b100a7316b3e0a593fcf23407e3e993 (diff)
data: restore withTrackSections, but simpler now
Diffstat (limited to 'src/data/composite/things')
-rw-r--r--src/data/composite/things/album/index.js1
-rw-r--r--src/data/composite/things/album/withTrackSections.js21
-rw-r--r--src/data/composite/things/album/withTracks.js13
3 files changed, 25 insertions, 10 deletions
diff --git a/src/data/composite/things/album/index.js b/src/data/composite/things/album/index.js
index 8b5098f0..0ef91b87 100644
--- a/src/data/composite/things/album/index.js
+++ b/src/data/composite/things/album/index.js
@@ -1 +1,2 @@
+export {default as withTrackSections} from './withTrackSections.js';
 export {default as withTracks} from './withTracks.js';
diff --git a/src/data/composite/things/album/withTrackSections.js b/src/data/composite/things/album/withTrackSections.js
new file mode 100644
index 00000000..a56bda31
--- /dev/null
+++ b/src/data/composite/things/album/withTrackSections.js
@@ -0,0 +1,21 @@
+import {input, templateCompositeFrom} from '#composite';
+
+import find from '#find';
+
+import {withResolvedReferenceList} from '#composite/wiki-data';
+
+export default templateCompositeFrom({
+  annotation: `withTrackSections`,
+
+  outputs: ['#trackSections'],
+
+  steps: () => [
+    withResolvedReferenceList({
+      list: 'trackSections',
+      data: 'ownTrackSectionData',
+      find: input.value(find.unqualifiedTrackSection),
+    }).outputs({
+      ['#resolvedReferenceList']: '#trackSections',
+    }),
+  ],
+});
diff --git a/src/data/composite/things/album/withTracks.js b/src/data/composite/things/album/withTracks.js
index 3fe6dd2e..c8d27c4c 100644
--- a/src/data/composite/things/album/withTracks.js
+++ b/src/data/composite/things/album/withTracks.js
@@ -1,24 +1,17 @@
 import {input, templateCompositeFrom} from '#composite';
 
-import find from '#find';
-
-import {exitWithoutDependency} from '#composite/control-flow';
 import {withFlattenedList, withPropertyFromList} from '#composite/data';
 import {withResolvedReferenceList} from '#composite/wiki-data';
 
+import withTrackSections from './withTrackSections.js';
+
 export default templateCompositeFrom({
   annotation: `withTracks`,
 
   outputs: ['#tracks'],
 
   steps: () => [
-    withResolvedReferenceList({
-      list: 'trackSections',
-      data: 'ownTrackSectionData',
-      find: input.value(find.unqualifiedTrackSection),
-    }).outputs({
-      ['#resolvedReferenceList']: '#trackSections',
-    }),
+    withTrackSections(),
 
     withPropertyFromList({
       list: '#trackSections',