« get me outta code hell

data: use soupyFind everywhere - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-01-11 00:11:37 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-11 00:11:37 -0400
commit9d99dafca9dc4e16b867b707746314040a8d9ba5 (patch)
tree6928b4efcaeac5508d06c74ac3bfeefce0ce4b7d /src/data/composite
parent8bbd9ac0b5cf8cc64ccbae7ae16b23f05d93d880 (diff)
data: use soupyFind everywhere
also notes where remaining directly-provided wikiData() props
are used
Diffstat (limited to 'src/data/composite')
-rw-r--r--src/data/composite/things/contribution/withContributionArtist.js11
-rw-r--r--src/data/composite/things/track/withAlwaysReferenceByDirectory.js4
-rw-r--r--src/data/composite/things/track/withOriginalRelease.js10
-rw-r--r--src/data/composite/wiki-data/withParsedCommentaryEntries.js4
-rw-r--r--src/data/composite/wiki-data/withResolvedContribs.js3
-rw-r--r--src/data/composite/wiki-data/withResolvedSeriesList.js4
6 files changed, 13 insertions, 23 deletions
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({
diff --git a/src/data/composite/wiki-data/withParsedCommentaryEntries.js b/src/data/composite/wiki-data/withParsedCommentaryEntries.js
index 144781a8..d302b59e 100644
--- a/src/data/composite/wiki-data/withParsedCommentaryEntries.js
+++ b/src/data/composite/wiki-data/withParsedCommentaryEntries.js
@@ -11,6 +11,7 @@ import {
   withUnflattenedList,
 } from '#composite/data';
 
+import inputSoupyFind from './inputSoupyFind.js';
 import withResolvedReferenceList from './withResolvedReferenceList.js';
 
 export default templateCompositeFrom({
@@ -122,8 +123,7 @@ export default templateCompositeFrom({
 
     withResolvedReferenceList({
       list: '#flattenedList',
-      data: 'artistData',
-      find: input.value(find.artist),
+      find: inputSoupyFind.input('artist'),
       notFoundMode: input.value('null'),
     }),
 
diff --git a/src/data/composite/wiki-data/withResolvedContribs.js b/src/data/composite/wiki-data/withResolvedContribs.js
index fd3d8a0d..838c991f 100644
--- a/src/data/composite/wiki-data/withResolvedContribs.js
+++ b/src/data/composite/wiki-data/withResolvedContribs.js
@@ -110,6 +110,7 @@ export default templateCompositeFrom({
         '#thingProperty',
         input('artistProperty'),
         input.myself(),
+        'find',
       ],
 
       compute: (continuation, {
@@ -117,6 +118,7 @@ export default templateCompositeFrom({
         ['#thingProperty']: thingProperty,
         [input('artistProperty')]: artistProperty,
         [input.myself()]: myself,
+        ['find']: find,
       }) => continuation({
         ['#contributions']:
           details.map(details => {
@@ -127,6 +129,7 @@ export default templateCompositeFrom({
               thing: myself,
               thingProperty: thingProperty,
               artistProperty: artistProperty,
+              find: find,
             });
 
             return contrib;
diff --git a/src/data/composite/wiki-data/withResolvedSeriesList.js b/src/data/composite/wiki-data/withResolvedSeriesList.js
index 4ac74cc3..d31aa01a 100644
--- a/src/data/composite/wiki-data/withResolvedSeriesList.js
+++ b/src/data/composite/wiki-data/withResolvedSeriesList.js
@@ -12,6 +12,7 @@ import {
   withPropertiesFromList,
 } from '#composite/data';
 
+import inputSoupyFind from './inputSoupyFind.js';
 import withResolvedReferenceList from './withResolvedReferenceList.js';
 
 export default templateCompositeFrom({
@@ -62,8 +63,7 @@ export default templateCompositeFrom({
 
     withResolvedReferenceList({
       list: '#flattenedList',
-      data: 'albumData',
-      find: input.value(find.album),
+      find: inputSoupyFind.input('album'),
       notFoundMode: input.value('null'),
     }),