From 2383ce6c48e499e486e8ede66621af11af237c46 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 20 May 2024 11:20:17 -0300 Subject: data: restore withTrackSections, but simpler now --- src/data/composite/things/album/index.js | 1 + .../composite/things/album/withTrackSections.js | 21 +++++++++++++++++++++ src/data/composite/things/album/withTracks.js | 13 +++---------- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 src/data/composite/things/album/withTrackSections.js (limited to 'src/data/composite') 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', -- cgit 1.3.0-6-gf8a5