From 0dc4db58b90f46cc938b72d571d690e197c6c243 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 5 Aug 2024 12:19:58 -0300 Subject: data, test: Album.trackSections: use direct links --- src/data/composite/things/album/index.js | 1 - .../composite/things/album/withTrackSections.js | 21 --------------------- src/data/composite/things/album/withTracks.js | 9 ++++++--- src/data/things/album.js | 19 ++++--------------- 4 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 src/data/composite/things/album/withTrackSections.js (limited to 'src') diff --git a/src/data/composite/things/album/index.js b/src/data/composite/things/album/index.js index 0ef91b87..8b5098f0 100644 --- a/src/data/composite/things/album/index.js +++ b/src/data/composite/things/album/index.js @@ -1,2 +1 @@ -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 deleted file mode 100644 index a56bda31..00000000 --- a/src/data/composite/things/album/withTrackSections.js +++ /dev/null @@ -1,21 +0,0 @@ -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 c8d27c4c..348220e7 100644 --- a/src/data/composite/things/album/withTracks.js +++ b/src/data/composite/things/album/withTracks.js @@ -3,7 +3,7 @@ import {input, templateCompositeFrom} from '#composite'; import {withFlattenedList, withPropertyFromList} from '#composite/data'; import {withResolvedReferenceList} from '#composite/wiki-data'; -import withTrackSections from './withTrackSections.js'; +import {raiseOutputWithoutDependency} from '#composite/control-flow'; export default templateCompositeFrom({ annotation: `withTracks`, @@ -11,10 +11,13 @@ export default templateCompositeFrom({ outputs: ['#tracks'], steps: () => [ - withTrackSections(), + raiseOutputWithoutDependency({ + dependency: 'trackSections', + output: input.value({'#tracks': []}), + }), withPropertyFromList({ - list: '#trackSections', + list: 'trackSections', property: input.value('tracks'), }), diff --git a/src/data/things/album.js b/src/data/things/album.js index ee99c814..f1a7df3d 100644 --- a/src/data/things/album.js +++ b/src/data/things/album.js @@ -44,6 +44,7 @@ import { simpleString, singleReference, thing, + thingList, urls, wikiData, } from '#composite/wiki-properties'; @@ -136,10 +137,8 @@ export class Album extends Thing { creditSources: commentary(), additionalFiles: additionalFiles(), - trackSections: referenceList({ - referenceType: input.value('unqualified-track-section'), - data: 'ownTrackSectionData', - find: input.value(find.unqualifiedTrackSection), + trackSections: thingList({ + class: input.value(TrackSection), }), artistContribs: contributionList({ @@ -223,10 +222,6 @@ export class Album extends Thing { class: input.value(Group), }), - ownTrackSectionData: wikiData({ - class: input.value(TrackSection), - }), - wikiInfo: thing({ class: input.value(WikiInfo), }), @@ -476,13 +471,7 @@ export class Album extends Thing { albumData.push(album); - album.trackSections = - trackSections - .map(trackSection => - `unqualified-track-section:` + - trackSection.unqualifiedDirectory); - - album.ownTrackSectionData = trackSections; + album.trackSections = trackSections; } return {albumData, trackSectionData, trackData}; -- cgit 1.3.0-6-gf8a5