« get me outta code hell

data: Track, Album: concise-retouch toplevel property descriptors - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-11-27 21:09:29 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-11-27 21:09:29 -0400
commitf2161a3fe8ff9b574f53156d08ca7853427be8e4 (patch)
treed79e117ddf638729c20c4e4deb847ae5a50d92ca /src/data/composite/wiki-data
parent861810685da73fa9fd6d4a1cb965155c61c99d11 (diff)
data: Track, Album: concise-retouch toplevel property descriptors
notably chopped exitWithoutArtwork and contribsPresent,
replaced with new hasArtwork and more exitWithoutDependency
Diffstat (limited to 'src/data/composite/wiki-data')
-rw-r--r--src/data/composite/wiki-data/exitWithoutArtwork.js45
-rw-r--r--src/data/composite/wiki-data/index.js2
-rw-r--r--src/data/composite/wiki-data/withHasArtwork.js97
3 files changed, 0 insertions, 144 deletions
diff --git a/src/data/composite/wiki-data/exitWithoutArtwork.js b/src/data/composite/wiki-data/exitWithoutArtwork.js
deleted file mode 100644
index 8e799fda..00000000
--- a/src/data/composite/wiki-data/exitWithoutArtwork.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import {input, templateCompositeFrom} from '#composite';
-import {isContributionList, isThing, strictArrayOf} from '#validators';
-
-import {exitWithoutDependency} from '#composite/control-flow';
-
-import withHasArtwork from './withHasArtwork.js';
-
-export default templateCompositeFrom({
-  annotation: `exitWithoutArtwork`,
-
-  inputs: {
-    contribs: input({
-      validate: isContributionList,
-      defaultValue: null,
-    }),
-
-    artwork: input({
-      validate: isThing,
-      defaultValue: null,
-    }),
-
-    artworks: input({
-      validate: strictArrayOf(isThing),
-      defaultValue: null,
-    }),
-
-    value: input({
-      defaultValue: null,
-    }),
-  },
-
-  steps: () => [
-    withHasArtwork({
-      contribs: input('contribs'),
-      artwork: input('artwork'),
-      artworks: input('artworks'),
-    }),
-
-    exitWithoutDependency({
-      dependency: '#hasArtwork',
-      mode: input.value('falsy'),
-      value: input('value'),
-    }),
-  ],
-});
diff --git a/src/data/composite/wiki-data/index.js b/src/data/composite/wiki-data/index.js
index beb6f3b8..41f34d21 100644
--- a/src/data/composite/wiki-data/index.js
+++ b/src/data/composite/wiki-data/index.js
@@ -7,7 +7,6 @@
 export {default as constituteFrom} from './constituteFrom.js';
 export {default as constituteOrContinue} from './constituteOrContinue.js';
 export {default as exitWithoutContribs} from './exitWithoutContribs.js';
-export {default as exitWithoutArtwork} from './exitWithoutArtwork.js';
 export {default as gobbleSoupyFind} from './gobbleSoupyFind.js';
 export {default as gobbleSoupyReverse} from './gobbleSoupyReverse.js';
 export {default as inputFindOptions} from './inputFindOptions.js';
@@ -21,7 +20,6 @@ export {default as withConstitutedArtwork} from './withConstitutedArtwork.js';
 export {default as withContentNodes} from './withContentNodes.js';
 export {default as withContributionListSums} from './withContributionListSums.js';
 export {default as withDirectory} from './withDirectory.js';
-export {default as withHasArtwork} from './withHasArtwork.js';
 export {default as withRecontextualizedContributionList} from './withRecontextualizedContributionList.js';
 export {default as withRedatedContributionList} from './withRedatedContributionList.js';
 export {default as withResolvedAnnotatedReferenceList} from './withResolvedAnnotatedReferenceList.js';
diff --git a/src/data/composite/wiki-data/withHasArtwork.js b/src/data/composite/wiki-data/withHasArtwork.js
deleted file mode 100644
index 9c22f439..00000000
--- a/src/data/composite/wiki-data/withHasArtwork.js
+++ /dev/null
@@ -1,97 +0,0 @@
-import {input, templateCompositeFrom} from '#composite';
-import {isContributionList, isThing, strictArrayOf} from '#validators';
-
-import {raiseOutputWithoutDependency, withResultOfAvailabilityCheck}
-  from '#composite/control-flow';
-import {fillMissingListItems, withFlattenedList, withPropertyFromList}
-  from '#composite/data';
-
-export default templateCompositeFrom({
-  annotation: 'withHasArtwork',
-
-  inputs: {
-    contribs: input({
-      validate: isContributionList,
-      defaultValue: null,
-    }),
-
-    artwork: input({
-      validate: isThing,
-      defaultValue: null,
-    }),
-
-    artworks: input({
-      validate: strictArrayOf(isThing),
-      defaultValue: null,
-    }),
-  },
-
-  outputs: ['#hasArtwork'],
-
-  steps: () => [
-    withResultOfAvailabilityCheck({
-      from: input('contribs'),
-      mode: input.value('empty'),
-    }),
-
-    {
-      dependencies: ['#availability'],
-      compute: (continuation, {
-        ['#availability']: availability,
-      }) =>
-        (availability
-          ? continuation.raiseOutput({
-              ['#hasArtwork']: true,
-            })
-          : continuation()),
-    },
-
-    {
-      dependencies: [input('artwork'), input('artworks')],
-      compute: (continuation, {
-        [input('artwork')]: artwork,
-        [input('artworks')]: artworks,
-      }) =>
-        continuation({
-          ['#artworks']:
-            (artwork && artworks
-              ? [artwork, ...artworks]
-           : artwork
-              ? [artwork]
-           : artworks
-              ? artworks
-              : []),
-        }),
-    },
-
-    raiseOutputWithoutDependency({
-      dependency: '#artworks',
-      mode: input.value('empty'),
-      output: input.value({'#hasArtwork': false}),
-    }),
-
-    withPropertyFromList({
-      list: '#artworks',
-      property: input.value('artistContribs'),
-      internal: input.value(true),
-    }),
-
-    // Since we're getting the update value for each artwork's artistContribs,
-    // it may not be set at all, and in that case won't be exposing as [].
-    fillMissingListItems({
-      list: '#artworks.artistContribs',
-      fill: input.value([]),
-    }),
-
-    withFlattenedList({
-      list: '#artworks.artistContribs',
-    }),
-
-    withResultOfAvailabilityCheck({
-      from: '#flattenedList',
-      mode: input.value('empty'),
-    }).outputs({
-      '#availability': '#hasArtwork',
-    }),
-  ],
-});