« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/artist.js23
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'),
     }),