From fb319c8e0bf69d9925389edf674de938ea489e25 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 30 Oct 2024 15:45:13 -0300 Subject: data, content: remove shared and inferred additional names Removes: - inferredAdditionalNameList (#composite/things/track) etc - sharedAdditionalNameList (#composite/things/track) etc - "specificAlbumExclusive" / "This Album Only" field - "from" property / "on {ALBUMS}" accent (content) - generateTrackAdditionalNamesBox (no leftover dynamics) - related snapshot test --- src/data/composite/things/track/index.js | 2 - .../things/track/inferredAdditionalNameList.js | 67 ---------------------- .../things/track/sharedAdditionalNameList.js | 58 ------------------- 3 files changed, 127 deletions(-) delete mode 100644 src/data/composite/things/track/inferredAdditionalNameList.js delete mode 100644 src/data/composite/things/track/sharedAdditionalNameList.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 714858a0..63ede4cf 100644 --- a/src/data/composite/things/track/index.js +++ b/src/data/composite/things/track/index.js @@ -1,8 +1,6 @@ export {default as exitWithoutUniqueCoverArt} from './exitWithoutUniqueCoverArt.js'; -export {default as inferredAdditionalNameList} from './inferredAdditionalNameList.js'; export {default as inheritContributionListFromOriginalRelease} from './inheritContributionListFromOriginalRelease.js'; export {default as inheritFromOriginalRelease} from './inheritFromOriginalRelease.js'; -export {default as sharedAdditionalNameList} from './sharedAdditionalNameList.js'; export {default as trackReverseReferenceList} from './trackReverseReferenceList.js'; export {default as withAlbum} from './withAlbum.js'; export {default as withAlwaysReferenceByDirectory} from './withAlwaysReferenceByDirectory.js'; diff --git a/src/data/composite/things/track/inferredAdditionalNameList.js b/src/data/composite/things/track/inferredAdditionalNameList.js deleted file mode 100644 index 58e8d2a1..00000000 --- a/src/data/composite/things/track/inferredAdditionalNameList.js +++ /dev/null @@ -1,67 +0,0 @@ -// Infers additional name entries from other releases that were titled -// differently; the corresponding releases are stored in eacn entry's "from" -// array, which will include multiple items, if more than one other release -// shares the same name differing from this one's. - -import {input, templateCompositeFrom} from '#composite'; -import {chunkByProperties} from '#sugar'; - -import {exitWithoutDependency} from '#composite/control-flow'; -import {withFilteredList, withPropertyFromList} from '#composite/data'; -import {withThingsSortedAlphabetically} from '#composite/wiki-data'; - -import withOtherReleases from './withOtherReleases.js'; - -export default templateCompositeFrom({ - annotation: `inferredAdditionalNameList`, - - compose: false, - - steps: () => [ - withOtherReleases(), - - exitWithoutDependency({ - dependency: '#otherReleases', - mode: input.value('empty'), - value: input.value([]), - }), - - withPropertyFromList({ - list: '#otherReleases', - property: input.value('name'), - }), - - { - dependencies: ['#otherReleases.name', 'name'], - compute: (continuation, { - ['#otherReleases.name']: releaseNames, - ['name']: ownName, - }) => continuation({ - ['#nameFilter']: - releaseNames.map(name => name !== ownName), - }), - }, - - withFilteredList({ - list: '#otherReleases', - filter: '#nameFilter', - }).outputs({ - '#filteredList': '#differentlyNamedReleases', - }), - - withThingsSortedAlphabetically({ - things: '#differentlyNamedReleases', - }).outputs({ - '#sortedThings': '#differentlyNamedReleases', - }), - - { - dependencies: ['#differentlyNamedReleases'], - compute: ({ - ['#differentlyNamedReleases']: releases, - }) => - chunkByProperties(releases, ['name']) - .map(({name, chunk}) => ({name, from: chunk})), - }, - ], -}); diff --git a/src/data/composite/things/track/sharedAdditionalNameList.js b/src/data/composite/things/track/sharedAdditionalNameList.js deleted file mode 100644 index 28c04101..00000000 --- a/src/data/composite/things/track/sharedAdditionalNameList.js +++ /dev/null @@ -1,58 +0,0 @@ -// Compiles additional names directly provided by other releases. - -import {input, templateCompositeFrom} from '#composite'; - -import {exitWithoutDependency, exposeDependency} - from '#composite/control-flow'; - -import { - withFilteredList, - withFlattenedList, - withPropertyFromList, -} from '#composite/data'; - -import withOtherReleases from './withOtherReleases.js'; - -export default templateCompositeFrom({ - annotation: `sharedAdditionalNameList`, - - compose: false, - - steps: () => [ - withOtherReleases(), - - exitWithoutDependency({ - dependency: '#otherReleases', - mode: input.value('empty'), - value: input.value([]), - }), - - withPropertyFromList({ - list: '#otherReleases', - property: input.value('additionalNames'), - }), - - withFlattenedList({ - list: '#otherReleases.additionalNames', - }).outputs({ - ['#flattenedList']: '#otherReleaseEntries', - }), - - withPropertyFromList({ - list: '#otherReleaseEntries', - property: input.value('specificAlbumExclusive'), - }), - - // Filter out entries that have been marked as exclusive to the containing - // album. - withFilteredList({ - list: '#otherReleaseEntries', - filter: '#otherReleaseEntries.specificAlbumExclusive', - flip: input.value(true), - }), - - exposeDependency({ - dependency: '#filteredList', - }), - ], -}); -- cgit 1.3.0-6-gf8a5