diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-01-11 11:25:44 -0400 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-01-11 11:25:44 -0400 |
| commit | 3c9d3cc91b9b1bb31fa2129d922a4539af171a2b (patch) | |
| tree | fffcbb5b5e7020687686d4de4842117b230afd3f /src/data/things/artist.js | |
| parent | 8537d590ce070ef72317188e3b13a89b13b08d6c (diff) | |
data: Artist.mockSimpleContribution + clever context
Diffstat (limited to 'src/data/things/artist.js')
| -rw-r--r-- | src/data/things/artist.js | 23 |
1 files changed, 22 insertions, 1 deletions
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'), }), |