From 9d99dafca9dc4e16b867b707746314040a8d9ba5 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 11 Jan 2025 00:11:37 -0400 Subject: data: use soupyFind everywhere also notes where remaining directly-provided wikiData() props are used --- .../composite/things/contribution/withContributionArtist.js | 11 ++--------- .../composite/things/track/withAlwaysReferenceByDirectory.js | 4 ++-- src/data/composite/things/track/withOriginalRelease.js | 10 ++-------- 3 files changed, 6 insertions(+), 19 deletions(-) (limited to 'src/data/composite/things') diff --git a/src/data/composite/things/contribution/withContributionArtist.js b/src/data/composite/things/contribution/withContributionArtist.js index 5a611c1a..50f60486 100644 --- a/src/data/composite/things/contribution/withContributionArtist.js +++ b/src/data/composite/things/contribution/withContributionArtist.js @@ -1,8 +1,8 @@ import {input, templateCompositeFrom} from '#composite'; import find from '#find'; -import {withPropertyFromObject} from '#composite/data'; import {withResolvedReference} from '#composite/wiki-data'; +import {soupyFind} from '#composite/wiki-properties'; export default templateCompositeFrom({ annotation: `withContributionArtist`, @@ -17,16 +17,9 @@ export default templateCompositeFrom({ outputs: ['#artist'], steps: () => [ - withPropertyFromObject({ - object: 'thing', - property: input.value('artistData'), - internal: input.value(true), - }), - withResolvedReference({ ref: input('ref'), - data: '#thing.artistData', - find: input.value(find.artist), + find: soupyFind.input('artist'), }).outputs({ '#resolvedReference': '#artist', }), diff --git a/src/data/composite/things/track/withAlwaysReferenceByDirectory.js b/src/data/composite/things/track/withAlwaysReferenceByDirectory.js index e01720b4..26c5ba97 100644 --- a/src/data/composite/things/track/withAlwaysReferenceByDirectory.js +++ b/src/data/composite/things/track/withAlwaysReferenceByDirectory.js @@ -9,6 +9,7 @@ import {isBoolean} from '#validators'; import {withPropertyFromObject} from '#composite/data'; import {withResolvedReference} from '#composite/wiki-data'; +import {soupyFind} from '#composite/wiki-properties'; import { exitWithoutDependency, @@ -31,8 +32,7 @@ export default templateCompositeFrom({ // recurse back into alwaysReferenceByDirectory! withResolvedReference({ ref: 'dataSourceAlbum', - data: 'albumData', - find: input.value(find.album), + find: soupyFind.input('album'), }).outputs({ '#resolvedReference': '#album', }), diff --git a/src/data/composite/things/track/withOriginalRelease.js b/src/data/composite/things/track/withOriginalRelease.js index c7f49657..59302eac 100644 --- a/src/data/composite/things/track/withOriginalRelease.js +++ b/src/data/composite/things/track/withOriginalRelease.js @@ -11,18 +11,13 @@ import {validateWikiData} from '#validators'; import {exitWithoutDependency, withResultOfAvailabilityCheck} from '#composite/control-flow'; import {withResolvedReference} from '#composite/wiki-data'; +import {soupyFind} from '#composite/wiki-properties'; export default templateCompositeFrom({ annotation: `withOriginalRelease`, inputs: { selfIfOriginal: input({type: 'boolean', defaultValue: false}), - - data: input({ - validate: validateWikiData({referenceType: 'track'}), - defaultDependency: 'trackData', - }), - notFoundValue: input({defaultValue: null}), }, @@ -55,8 +50,7 @@ export default templateCompositeFrom({ withResolvedReference({ ref: 'originalReleaseTrack', - data: input('data'), - find: input.value(find.track), + find: soupyFind.input('track'), }), exitWithoutDependency({ -- cgit 1.3.0-6-gf8a5