« get me outta code hell

data: withResolvedArtworkReferenceList -> ...Annotated - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-11-16 13:51:25 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-11-17 13:40:00 -0400
commitd28e04697429b607c38042ac09418adfceb06baf (patch)
tree4e6d422c065ab0925d9547865061b380db247276 /src
parent65ff74446f22976613caf352d42253c8c17e172d (diff)
data: withResolvedArtworkReferenceList -> ...Annotated
Diffstat (limited to 'src')
-rw-r--r--src/data/composite/wiki-data/index.js2
-rw-r--r--src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js (renamed from src/data/composite/wiki-data/withResolvedArtworkReferenceList.js)6
-rw-r--r--src/data/composite/wiki-properties/referencedArtworkList.js13
-rw-r--r--src/data/things/album.js4
-rw-r--r--src/data/things/track.js4
-rw-r--r--src/data/yaml.js2
6 files changed, 14 insertions, 17 deletions
diff --git a/src/data/composite/wiki-data/index.js b/src/data/composite/wiki-data/index.js
index e1589093..581dafc8 100644
--- a/src/data/composite/wiki-data/index.js
+++ b/src/data/composite/wiki-data/index.js
@@ -14,7 +14,7 @@ export {default as withDirectory} from './withDirectory.js';
 export {default as withParsedCommentaryEntries} from './withParsedCommentaryEntries.js';
 export {default as withRecontextualizedContributionList} from './withRecontextualizedContributionList.js';
 export {default as withRedatedContributionList} from './withRedatedContributionList.js';
-export {default as withResolvedArtworkReferenceList} from './withResolvedArtworkReferenceList.js';
+export {default as withResolvedAnnotatedReferenceList} from './withResolvedAnnotatedReferenceList.js';
 export {default as withResolvedContribs} from './withResolvedContribs.js';
 export {default as withResolvedReference} from './withResolvedReference.js';
 export {default as withResolvedReferenceList} from './withResolvedReferenceList.js';
diff --git a/src/data/composite/wiki-data/withResolvedArtworkReferenceList.js b/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js
index 38c65a8d..341fdb3d 100644
--- a/src/data/composite/wiki-data/withResolvedArtworkReferenceList.js
+++ b/src/data/composite/wiki-data/withResolvedAnnotatedReferenceList.js
@@ -12,7 +12,7 @@ import raiseResolvedReferenceList from './raiseResolvedReferenceList.js';
 import withResolvedReferenceList from './withResolvedReferenceList.js';
 
 export default templateCompositeFrom({
-  annotation: `withResolvedArtworkReferenceList`,
+  annotation: `withResolvedAnnotatedReferenceList`,
 
   inputs: {
     list: input({
@@ -32,7 +32,7 @@ export default templateCompositeFrom({
     notFoundMode: inputNotFoundMode(),
   },
 
-  outputs: ['#resolvedArtworkReferenceList'],
+  outputs: ['#resolvedAnnotatedReferenceList'],
 
   steps: () => [
     withPropertiesFromList({
@@ -76,7 +76,7 @@ export default templateCompositeFrom({
       notFoundMode: input('notFoundMode'),
       results: '#matches',
       filter: '#availabilityFilter',
-      outputs: input.value('#resolvedArtworkReferenceList'),
+      outputs: input.value('#resolvedAnnotatedReferenceList'),
     }),
   ],
 })
diff --git a/src/data/composite/wiki-properties/referencedArtworkList.js b/src/data/composite/wiki-properties/referencedArtworkList.js
index 251944e5..db4d4637 100644
--- a/src/data/composite/wiki-properties/referencedArtworkList.js
+++ b/src/data/composite/wiki-properties/referencedArtworkList.js
@@ -4,18 +4,15 @@ import {validateAnnotatedReferenceList} from '#validators';
 import {combineWikiDataArrays} from '#wiki-data';
 
 import {exposeDependency} from '#composite/control-flow';
-import {withResolvedArtworkReferenceList} from '#composite/wiki-data';
+import {withResolvedAnnotatedReferenceList} from '#composite/wiki-data';
 
 export default templateCompositeFrom({
   annotation: `referencedArtworkList`,
 
-  update: ({
-    [input.staticValue('class')]: thingClass,
-    [input.staticValue('referenceType')]: referenceType,
-  }) => ({
+  update: {
     validate:
       validateAnnotatedReferenceList(['album', 'track']),
-  }),
+  },
 
   steps: () => [
     {
@@ -46,12 +43,12 @@ export default templateCompositeFrom({
       }),
     },
 
-    withResolvedArtworkReferenceList({
+    withResolvedAnnotatedReferenceList({
       list: input.updateValue(),
       data: '#data',
       find: '#find',
     }),
 
-    exposeDependency({dependency: '#resolvedArtworkReferenceList'}),
+    exposeDependency({dependency: '#resolvedAnnotatedReferenceList'}),
   ],
 });
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 6bfec68c..b6bd1313 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -16,10 +16,10 @@ import {isColor, isDate, isDirectory, validateWikiData} from '#validators';
 import {
   parseAdditionalFiles,
   parseAdditionalNames,
+  parseAnnotatedReferences,
   parseContributors,
   parseDate,
   parseDimensions,
-  parseReferencedArtworks,
 } from '#yaml';
 
 import {exitWithoutDependency, exposeDependency, exposeUpdateValueOrContinue}
@@ -414,7 +414,7 @@ export class Album extends Thing {
 
       'Referenced Artworks': {
         property: 'referencedArtworks',
-        transform: parseReferencedArtworks,
+        transform: parseAnnotatedReferences,
       },
 
       'Franchises': {ignore: true},
diff --git a/src/data/things/track.js b/src/data/things/track.js
index d86c7635..5c3161aa 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -11,11 +11,11 @@ import {isBoolean, isColor, isContributionList, isDate, isFileExtension}
 import {
   parseAdditionalFiles,
   parseAdditionalNames,
+  parseAnnotatedReferences,
   parseContributors,
   parseDate,
   parseDimensions,
   parseDuration,
-  parseReferencedArtworks,
 } from '#yaml';
 
 import {withPropertyFromObject} from '#composite/data';
@@ -526,7 +526,7 @@ export class Track extends Thing {
 
       'Referenced Artworks': {
         property: 'referencedArtworks',
-        transform: parseReferencedArtworks,
+        transform: parseAnnotatedReferences,
       },
 
       'Franchises': {ignore: true},
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 1218a8a0..37d6daf0 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -569,7 +569,7 @@ export function parseContributionPresets(list) {
   });
 }
 
-export function parseReferencedArtworks(entries) {
+export function parseAnnotatedReferences(entries) {
   return parseArrayEntries(entries, item => {
     if (typeof item === 'object' && item['References'])
       return {