« get me outta code hell

data: Track: chop withAllReleases - 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-11-25 16:15:00 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-11-25 16:15:00 -0400
commit7cf701e6e44dbbd15694542969b48b6707ab0c24 (patch)
tree6e8ff13580b00a163d4d2faa161c314a0d0aae76 /src/data/composite
parent9c3f0a79ee38ee5a13617ed0406d42e579ed49f3 (diff)
data: Track: chop withAllReleases
Diffstat (limited to 'src/data/composite')
-rw-r--r--src/data/composite/things/track/index.js1
-rw-r--r--src/data/composite/things/track/withAllReleases.js57
-rw-r--r--src/data/composite/things/track/withOtherReleases.js8
3 files changed, 2 insertions, 64 deletions
diff --git a/src/data/composite/things/track/index.js b/src/data/composite/things/track/index.js
index 61807018..17e4aeff 100644
--- a/src/data/composite/things/track/index.js
+++ b/src/data/composite/things/track/index.js
@@ -2,7 +2,6 @@ export {default as alwaysReferenceByDirectory} from './alwaysReferenceByDirector
 export {default as exitWithoutUniqueCoverArt} from './exitWithoutUniqueCoverArt.js';
 export {default as inheritContributionListFromMainRelease} from './inheritContributionListFromMainRelease.js';
 export {default as inheritFromMainRelease} from './inheritFromMainRelease.js';
-export {default as withAllReleases} from './withAllReleases.js';
 export {default as withDirectorySuffix} from './withDirectorySuffix.js';
 export {default as withOtherReleases} from './withOtherReleases.js';
 export {default as withPropertyFromAlbum} from './withPropertyFromAlbum.js';
diff --git a/src/data/composite/things/track/withAllReleases.js b/src/data/composite/things/track/withAllReleases.js
deleted file mode 100644
index 078209a9..00000000
--- a/src/data/composite/things/track/withAllReleases.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Gets all releases of the current track. All items of the outputs are
-// distinct Track objects; one track is the main release; all else are
-// secondary releases of that main release; and one item, which may be
-// the main release or one of the secondary releases, is the current
-// track. The results are sorted by date, and it is possible that the
-// main release is not actually the earliest/first.
-
-import {input, templateCompositeFrom} from '#composite';
-import {sortByDate} from '#sort';
-
-import {withPropertyFromObject} from '#composite/data';
-
-export default templateCompositeFrom({
-  annotation: `withAllReleases`,
-
-  outputs: ['#allReleases'],
-
-  steps: () => [
-    {
-      dependencies: [
-        'mainReleaseTrack',
-        'secondaryReleases',
-        input.myself(),
-      ],
-
-      compute: (continuation, {
-        mainReleaseTrack,
-        secondaryReleases,
-        [input.myself()]: thisTrack,
-      }) =>
-        (mainReleaseTrack
-          ? continuation({
-              ['#mainReleaseTrack']: mainReleaseTrack,
-              ['#secondaryReleaseTracks']: mainReleaseTrack.secondaryReleases,
-            })
-          : continuation({
-              ['#mainReleaseTrack']: thisTrack,
-              ['#secondaryReleaseTracks']: secondaryReleases,
-            })),
-    },
-
-    {
-      dependencies: [
-        '#mainReleaseTrack',
-        '#secondaryReleaseTracks',
-      ],
-
-      compute: (continuation, {
-        ['#mainReleaseTrack']: mainReleaseTrack,
-        ['#secondaryReleaseTracks']: secondaryReleaseTracks,
-      }) => continuation({
-        ['#allReleases']:
-          sortByDate([mainReleaseTrack, ...secondaryReleaseTracks]),
-      }),
-    },
-  ],
-});
diff --git a/src/data/composite/things/track/withOtherReleases.js b/src/data/composite/things/track/withOtherReleases.js
index bb3e8983..ccf57deb 100644
--- a/src/data/composite/things/track/withOtherReleases.js
+++ b/src/data/composite/things/track/withOtherReleases.js
@@ -3,21 +3,17 @@
 
 import {input, templateCompositeFrom} from '#composite';
 
-import withAllReleases from './withAllReleases.js';
-
 export default templateCompositeFrom({
   annotation: `withOtherReleases`,
 
   outputs: ['#otherReleases'],
 
   steps: () => [
-    withAllReleases(),
-
     {
-      dependencies: [input.myself(), '#allReleases'],
+      dependencies: [input.myself(), 'allReleases'],
       compute: (continuation, {
         [input.myself()]: thisTrack,
-        ['#allReleases']: allReleases,
+        ['allReleases']: allReleases,
       }) => continuation({
         ['#otherReleases']:
           allReleases.filter(track => track !== thisTrack),