From 3c9d3cc91b9b1bb31fa2129d922a4539af171a2b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 11 Jan 2026 11:25:44 -0400 Subject: data: Artist.mockSimpleContribution + clever context --- src/data/things/artist.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/data/things') diff --git a/src/data/things/artist.js b/src/data/things/artist.js index a2ed0b74..01eb2172 100644 --- a/src/data/things/artist.js +++ b/src/data/things/artist.js @@ -43,7 +43,7 @@ export class Artist extends Thing { 'avatarArtwork', // from inline fields ]; - static [Thing.getPropertyDescriptors] = () => ({ + static [Thing.getPropertyDescriptors] = ({Contribution}) => ({ // Update & expose name: name(V('Unnamed Artist')), @@ -78,6 +78,27 @@ export class Artist extends Thing { isArtist: exposeConstant(V(true)), + mockSimpleContribution: { + flags: {expose: true}, + expose: { + dependencies: ['directory', '_find'], + compute: ({directory, _find: find}) => + Object.assign(new Contribution, { + artist: 'artist:' + directory, + + // These nulls have no effect, they're only included + // here for clarity. + date: null, + thing: null, + annotation: null, + artistProperty: null, + thingProperty: null, + + find, + }), + }, + }, + trackArtistContributions: reverseReferenceList({ reverse: soupyReverse.input('trackArtistContributionsBy'), }), -- cgit 1.3.0-6-gf8a5