From 3d6e0377e01a6c8c05ab3725cc0c30d02f318d0f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 25 Nov 2025 17:01:21 -0400 Subject: data: Track: chop withTrackNumber one """normative""" change: we're checking availability of #index correctly now (in index mode) --- src/data/composite/things/track/index.js | 1 - src/data/composite/things/track/withTrackNumber.js | 46 ---------------------- 2 files changed, 47 deletions(-) delete mode 100644 src/data/composite/things/track/withTrackNumber.js (limited to 'src/data/composite/things') diff --git a/src/data/composite/things/track/index.js b/src/data/composite/things/track/index.js index 8036d4df..f392cb8e 100644 --- a/src/data/composite/things/track/index.js +++ b/src/data/composite/things/track/index.js @@ -4,4 +4,3 @@ export {default as inheritContributionListFromMainRelease} from './inheritContri export {default as inheritFromMainRelease} from './inheritFromMainRelease.js'; export {default as withPropertyFromAlbum} from './withPropertyFromAlbum.js'; export {default as withPropertyFromMainRelease} from './withPropertyFromMainRelease.js'; -export {default as withTrackNumber} from './withTrackNumber.js'; diff --git a/src/data/composite/things/track/withTrackNumber.js b/src/data/composite/things/track/withTrackNumber.js deleted file mode 100644 index bb0f1366..00000000 --- a/src/data/composite/things/track/withTrackNumber.js +++ /dev/null @@ -1,46 +0,0 @@ -import {input, templateCompositeFrom} from '#composite'; - -import {raiseOutputWithoutDependency} from '#composite/control-flow'; -import {withIndexInList, withPropertiesFromObject} from '#composite/data'; - -export default templateCompositeFrom({ - annotation: `withTrackNumber`, - - outputs: ['#trackNumber'], - - steps: () => [ - // Zero is the fallback, not one, but in most albums the first track - // (and its intended output by this composition) will be one. - raiseOutputWithoutDependency({ - dependency: 'trackSection', - output: input.value({'#trackNumber': 0}), - }), - - withPropertiesFromObject({ - object: 'trackSection', - properties: input.value(['tracks', 'startCountingFrom']), - }), - - withIndexInList({ - list: '#trackSection.tracks', - item: input.myself(), - }), - - raiseOutputWithoutDependency({ - dependency: '#index', - output: input.value({'#trackNumber': 0}), - }), - - { - dependencies: ['#trackSection.startCountingFrom', '#index'], - compute: (continuation, { - ['#trackSection.startCountingFrom']: startCountingFrom, - ['#index']: index, - }) => continuation({ - ['#trackNumber']: - startCountingFrom + - index, - }), - }, - ], -}); -- cgit 1.3.0-6-gf8a5