diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-10-30 15:45:13 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-10-30 16:04:28 -0300 |
commit | fb319c8e0bf69d9925389edf674de938ea489e25 (patch) | |
tree | a60bd4f07ce72b9da394a3bf4db8fee91842eb78 /src/data | |
parent | 859d1777a4f6f6d583466aaf72357d4d611f3909 (diff) |
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
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/composite/things/track/index.js | 2 | ||||
-rw-r--r-- | src/data/composite/things/track/inferredAdditionalNameList.js | 67 | ||||
-rw-r--r-- | src/data/composite/things/track/sharedAdditionalNameList.js | 58 | ||||
-rw-r--r-- | src/data/things/track.js | 4 | ||||
-rw-r--r-- | src/data/validators.js | 15 | ||||
-rw-r--r-- | src/data/yaml.js | 2 |
6 files changed, 0 insertions, 148 deletions
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', - }), - ], -}); diff --git a/src/data/things/track.js b/src/data/things/track.js index faa5d7ef..e3526f1c 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -58,10 +58,8 @@ import { import { exitWithoutUniqueCoverArt, - inferredAdditionalNameList, inheritContributionListFromOriginalRelease, inheritFromOriginalRelease, - sharedAdditionalNameList, trackReverseReferenceList, withAlbum, withAlwaysReferenceByDirectory, @@ -91,8 +89,6 @@ export class Track extends Thing { directory: directory(), additionalNames: additionalNameList(), - sharedAdditionalNames: sharedAdditionalNameList(), - inferredAdditionalNames: inferredAdditionalNameList(), bandcampTrackIdentifier: simpleString(), bandcampArtworkIdentifier: simpleString(), diff --git a/src/data/validators.js b/src/data/validators.js index 22dc160c..31c7025a 100644 --- a/src/data/validators.js +++ b/src/data/validators.js @@ -920,21 +920,6 @@ export function validateWikiData({ export const isAdditionalName = validateProperties({ name: isContentString, annotation: optional(isContentString), - - // TODO: This only applies for tracks, not additional names - // in general. - specificAlbumExclusive: optional(isBoolean), - - // TODO: This only allows indicating sourcing from a track. - // That's okay for the current limited use of "from", but - // could be expanded later. - from: - // Double TODO: Explicitly allowing both references and - // live objects to co-exist is definitely weird, and - // altogether questions the way we define validators... - optional(anyOf( - validateReferenceList('track'), - validateWikiData({referenceType: 'track'}))), }); export const isAdditionalNameList = validateArrayItems(isAdditionalName); diff --git a/src/data/yaml.js b/src/data/yaml.js index e473790a..be59080e 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -451,7 +451,6 @@ export function parseAdditionalNames(entries) { return { name: item['Name'], annotation: item['Annotation'] ?? null, - specificAlbumExclusive: item['This Album Only'] ?? null, }; if (typeof item !== 'string') return item; @@ -462,7 +461,6 @@ export function parseAdditionalNames(entries) { return { name: match.groups.main, annotation: match.groups.accent ?? null, - specificAlbumExclusive: null, }; }); } |