« get me outta code hell

data: Track: chop withMainReleaseTrack - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/track/withMainReleaseTrack.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-11-25 16:08:30 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-11-25 16:08:48 -0400
commit9c3f0a79ee38ee5a13617ed0406d42e579ed49f3 (patch)
tree716f3f64418ecd5df3725e437640fd7f62cb9bfa /src/data/composite/things/track/withMainReleaseTrack.js
parente0ed41638ac5f76968499a16628f7054eae11158 (diff)
data: Track: chop withMainReleaseTrack
probably contains normative changes re: dropping notFoundValue
behavior in properties which inherit from main release, but has no
effect on good wiki data and maybe those compositions resolve
the same anyway...
Diffstat (limited to 'src/data/composite/things/track/withMainReleaseTrack.js')
-rw-r--r--src/data/composite/things/track/withMainReleaseTrack.js244
1 files changed, 0 insertions, 244 deletions
diff --git a/src/data/composite/things/track/withMainReleaseTrack.js b/src/data/composite/things/track/withMainReleaseTrack.js
deleted file mode 100644
index c92c2246..00000000
--- a/src/data/composite/things/track/withMainReleaseTrack.js
+++ /dev/null
@@ -1,244 +0,0 @@
-// Just provides the main release of this track as a dependency.
-// If this track isn't a secondary release, then it'll provide null, unless
-// the {selfIfMain} option is set, in which case it'll provide this track
-// itself. This will early exit (with notFoundValue) if the main release
-// is specified by reference and that reference doesn't resolve to anything.
-
-import {input, templateCompositeFrom} from '#composite';
-import {onlyItem} from '#sugar';
-import {getKebabCase} from '#wiki-data';
-
-import {
-  exitWithoutDependency,
-  withAvailabilityFilter,
-  withResultOfAvailabilityCheck,
-} from '#composite/control-flow';
-
-import {
-  withFilteredList,
-  withMappedList,
-  withPropertyFromList,
-  withPropertyFromObject,
-} from '#composite/data';
-
-export default templateCompositeFrom({
-  annotation: `withMainReleaseTrack`,
-
-  inputs: {
-    selfIfMain: input({type: 'boolean', defaultValue: false}),
-    notFoundValue: input({defaultValue: null}),
-  },
-
-  outputs: ['#mainReleaseTrack'],
-
-  steps: () => [
-    withResultOfAvailabilityCheck({
-      from: '_mainRelease',
-    }),
-
-    {
-      dependencies: [
-        input.myself(),
-        input('selfIfMain'),
-        '#availability',
-      ],
-
-      compute: (continuation, {
-        [input.myself()]: track,
-        [input('selfIfMain')]: selfIfMain,
-        '#availability': availability,
-      }) =>
-        (availability
-          ? continuation()
-          : continuation.raiseOutput({
-              ['#mainReleaseTrack']:
-                (selfIfMain ? track : null),
-            })),
-    },
-
-    exitWithoutDependency({
-      dependency: 'mainRelease',
-      value: input('notFoundValue'),
-    }),
-
-    withPropertyFromObject({
-      object: 'mainRelease',
-      property: input.value('isTrack'),
-    }),
-
-    {
-      dependencies: ['mainRelease', '#mainRelease.isTrack'],
-
-      compute: (continuation, {
-        ['mainRelease']: mainRelease,
-        ['#mainRelease.isTrack']: mainReleaseIsTrack,
-      }) =>
-        (mainReleaseIsTrack
-          ? continuation.raiseOutput({
-              ['#mainReleaseTrack']: mainRelease,
-            })
-          : continuation()),
-    },
-
-    {
-      dependencies: ['name', '_directory'],
-      compute: (continuation, {
-        ['name']: ownName,
-        ['_directory']: ownDirectory,
-      }) => {
-        const ownNameKebabed = getKebabCase(ownName);
-
-        return continuation({
-          ['#mapItsNameLikeName']:
-            name => getKebabCase(name) === ownNameKebabed,
-
-          ['#mapItsDirectoryLikeDirectory']:
-            (ownDirectory
-              ? directory => directory === ownDirectory
-              : () => false),
-
-          ['#mapItsNameLikeDirectory']:
-            (ownDirectory
-              ? name => getKebabCase(name) === ownDirectory
-              : () => false),
-
-          ['#mapItsDirectoryLikeName']:
-            directory => directory === ownNameKebabed,
-        });
-      },
-    },
-
-    withPropertyFromObject({
-      object: 'mainRelease',
-      property: input.value('tracks'),
-    }),
-
-    withPropertyFromList({
-      list: '#mainRelease.tracks',
-      property: input.value('mainRelease'),
-      internal: input.value(true),
-    }),
-
-    withAvailabilityFilter({
-      from: '#mainRelease.tracks.mainRelease',
-    }),
-
-    withMappedList({
-      list: '#availabilityFilter',
-      map: input.value(item => !item),
-    }).outputs({
-      '#mappedList': '#availabilityFilter',
-    }),
-
-    withFilteredList({
-      list: '#mainRelease.tracks',
-      filter: '#availabilityFilter',
-    }).outputs({
-      '#filteredList': '#mainRelease.tracks',
-    }),
-
-    withPropertyFromList({
-      list: '#mainRelease.tracks',
-      property: input.value('name'),
-    }),
-
-    withPropertyFromList({
-      list: '#mainRelease.tracks',
-      property: input.value('directory'),
-      internal: input.value(true),
-    }),
-
-    withMappedList({
-      list: '#mainRelease.tracks.name',
-      map: '#mapItsNameLikeName',
-    }).outputs({
-      '#mappedList': '#filterItsNameLikeName',
-    }),
-
-    withMappedList({
-      list: '#mainRelease.tracks.directory',
-      map: '#mapItsDirectoryLikeDirectory',
-    }).outputs({
-      '#mappedList': '#filterItsDirectoryLikeDirectory',
-    }),
-
-    withMappedList({
-      list: '#mainRelease.tracks.name',
-      map: '#mapItsNameLikeDirectory',
-    }).outputs({
-      '#mappedList': '#filterItsNameLikeDirectory',
-    }),
-
-    withMappedList({
-      list: '#mainRelease.tracks.directory',
-      map: '#mapItsDirectoryLikeName',
-    }).outputs({
-      '#mappedList': '#filterItsDirectoryLikeName',
-    }),
-
-    withFilteredList({
-      list: '#mainRelease.tracks',
-      filter: '#filterItsNameLikeName',
-    }).outputs({
-      '#filteredList': '#matchingItsNameLikeName',
-    }),
-
-    withFilteredList({
-      list: '#mainRelease.tracks',
-      filter: '#filterItsDirectoryLikeDirectory',
-    }).outputs({
-      '#filteredList': '#matchingItsDirectoryLikeDirectory',
-    }),
-
-    withFilteredList({
-      list: '#mainRelease.tracks',
-      filter: '#filterItsNameLikeDirectory',
-    }).outputs({
-      '#filteredList': '#matchingItsNameLikeDirectory',
-    }),
-
-    withFilteredList({
-      list: '#mainRelease.tracks',
-      filter: '#filterItsDirectoryLikeName',
-    }).outputs({
-      '#filteredList': '#matchingItsDirectoryLikeName',
-    }),
-
-    {
-      dependencies: [
-        '#matchingItsNameLikeName',
-        '#matchingItsDirectoryLikeDirectory',
-        '#matchingItsNameLikeDirectory',
-        '#matchingItsDirectoryLikeName',
-      ],
-
-      compute: (continuation, {
-        ['#matchingItsNameLikeName']:           NLN,
-        ['#matchingItsDirectoryLikeDirectory']: DLD,
-        ['#matchingItsNameLikeDirectory']:      NLD,
-        ['#matchingItsDirectoryLikeName']:      DLN,
-      }) => continuation({
-        ['#mainReleaseTrack']:
-          onlyItem(DLD) ??
-          onlyItem(NLN) ??
-          onlyItem(DLN) ??
-          onlyItem(NLD) ??
-          null,
-      }),
-    },
-
-    {
-      dependencies: ['#mainReleaseTrack', input.myself()],
-
-      compute: (continuation, {
-        ['#mainReleaseTrack']: mainReleaseTrack,
-        [input.myself()]: thisTrack,
-      }) => continuation({
-        ['#mainReleaseTrack']:
-          (mainReleaseTrack === thisTrack
-            ? null
-            : mainReleaseTrack),
-      }),
-    },
-  ],
-});