From 8f64d50645a6cabc16ba12d31e5872b693e860f6 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 25 Nov 2025 17:14:04 -0400 Subject: data: Track: chop withPropertyFromAlbum --- src/data/composite/things/track/index.js | 1 - .../things/track/withPropertyFromAlbum.js | 48 ---------------------- src/data/things/track.js | 37 +++++++++++------ 3 files changed, 24 insertions(+), 62 deletions(-) delete mode 100644 src/data/composite/things/track/withPropertyFromAlbum.js (limited to 'src') diff --git a/src/data/composite/things/track/index.js b/src/data/composite/things/track/index.js index 24b1c01b..88fd3d45 100644 --- a/src/data/composite/things/track/index.js +++ b/src/data/composite/things/track/index.js @@ -1,4 +1,3 @@ export {default as inheritContributionListFromMainRelease} from './inheritContributionListFromMainRelease.js'; export {default as inheritFromMainRelease} from './inheritFromMainRelease.js'; -export {default as withPropertyFromAlbum} from './withPropertyFromAlbum.js'; export {default as withPropertyFromMainRelease} from './withPropertyFromMainRelease.js'; diff --git a/src/data/composite/things/track/withPropertyFromAlbum.js b/src/data/composite/things/track/withPropertyFromAlbum.js deleted file mode 100644 index a203c2e7..00000000 --- a/src/data/composite/things/track/withPropertyFromAlbum.js +++ /dev/null @@ -1,48 +0,0 @@ -// Gets a single property from this track's album, providing it as the same -// property name prefixed with '#album.' (by default). - -import {input, templateCompositeFrom} from '#composite'; - -import {withPropertyFromObject} from '#composite/data'; - -export default templateCompositeFrom({ - annotation: `withPropertyFromAlbum`, - - inputs: { - property: input.staticValue({type: 'string'}), - internal: input({type: 'boolean', defaultValue: false}), - }, - - outputs: ({ - [input.staticValue('property')]: property, - }) => ['#album.' + property], - - steps: () => [ - // XXX: This is a ridiculous hack considering `defaultValue` above. - // If we were certain what was up, we'd just get around to fixing it LOL - { - dependencies: [input('internal')], - compute: (continuation, { - [input('internal')]: internal, - }) => continuation({ - ['#internal']: internal ?? false, - }), - }, - - withPropertyFromObject({ - object: 'album', - property: input('property'), - internal: '#internal', - }), - - { - dependencies: ['#value', input.staticValue('property')], - compute: (continuation, { - ['#value']: value, - [input.staticValue('property')]: property, - }) => continuation({ - ['#album.' + property]: value, - }), - }, - ], -}); diff --git a/src/data/things/track.js b/src/data/things/track.js index 75ffcfb7..39a1804f 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -89,7 +89,6 @@ import { import { inheritContributionListFromMainRelease, inheritFromMainRelease, - withPropertyFromAlbum, } from '#composite/things/track'; export class Track extends Thing { @@ -161,7 +160,8 @@ export class Track extends Thing { validate: input.value(isBoolean), }), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('alwaysReferenceTracksByDirectory'), }), @@ -306,7 +306,8 @@ export class Track extends Thing { validate: input.value(isContentString), }), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackArtistText'), }), @@ -324,7 +325,8 @@ export class Track extends Thing { dependency: '_artistText', }), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackArtistText'), }), @@ -352,7 +354,8 @@ export class Track extends Thing { // Secondary releases' artists may differ from the main release. inheritContributionListFromMainRelease(), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackArtistContribs'), }), @@ -412,7 +415,8 @@ export class Track extends Thing { exposeDependencyOrContinue({dependency: '#trackSection.color'}), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('color'), }), @@ -479,7 +483,8 @@ export class Track extends Thing { mode: input.value('empty'), }), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackCoverArtistContribs'), }), @@ -508,7 +513,8 @@ export class Track extends Thing { validate: input.value(isDate), }), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackArtDate'), }), @@ -531,7 +537,8 @@ export class Track extends Thing { validate: input.value(isFileExtension), }), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackCoverArtFileExtension'), }), @@ -550,7 +557,8 @@ export class Track extends Thing { exposeUpdateValueOrContinue(), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackDimensions'), }), @@ -704,7 +712,8 @@ export class Track extends Thing { dependency: 'dateFirstReleased', }), - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('date'), }), @@ -782,7 +791,8 @@ export class Track extends Thing { : continuation()), }, - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('trackCoverArtistContribs'), internal: input.value(true), }), @@ -1100,7 +1110,8 @@ export class Track extends Thing { ], groups: [ - withPropertyFromAlbum({ + withPropertyFromObject({ + object: 'album', property: input.value('groups'), }), -- cgit 1.3.0-6-gf8a5