From d2bc9d725c83ab8d6131598b7763c7e711f9697a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 19 Nov 2024 09:03:20 -0400 Subject: data: {Album, Track}.referencedByArtworks --- .../reverseReferencedArtworkList.js | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/data/composite/wiki-properties/reverseReferencedArtworkList.js (limited to 'src/data/composite/wiki-properties/reverseReferencedArtworkList.js') diff --git a/src/data/composite/wiki-properties/reverseReferencedArtworkList.js b/src/data/composite/wiki-properties/reverseReferencedArtworkList.js new file mode 100644 index 00000000..2950bdb9 --- /dev/null +++ b/src/data/composite/wiki-properties/reverseReferencedArtworkList.js @@ -0,0 +1,39 @@ +import {input, templateCompositeFrom} from '#composite'; +import {combineWikiDataArrays} from '#wiki-data'; + +import {exposeDependency} from '#composite/control-flow'; +import {inputWikiData, withReverseAnnotatedReferenceList} + from '#composite/wiki-data'; + +export default templateCompositeFrom({ + annotation: `reverseReferencedArtworkList`, + + compose: false, + + steps: () => [ + { + dependencies: [ + 'albumData', + 'trackData', + ], + + compute: (continuation, { + albumData, + trackData, + }) => continuation({ + ['#data']: + combineWikiDataArrays([ + albumData, + trackData, + ]), + }), + }, + + withReverseAnnotatedReferenceList({ + data: '#data', + list: input.value('referencedArtworks'), + }), + + exposeDependency({dependency: '#reverseAnnotatedReferenceList'}), + ], +}); -- cgit 1.3.0-6-gf8a5