« get me outta code hell

data: Artist.artistContributions, Artist.contributorContributions - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-07 12:22:02 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:41 -0300
commite98ddceb95d89e5e6541f15543fa4ffa6f04c29f (patch)
tree6b45b97361ddf1f047bf72a64fab820aae6e1337 /src/data
parent33944781fea780b2fdd714da45720631b7a21ba2 (diff)
data: Artist.artistContributions, Artist.contributorContributions
Diffstat (limited to 'src/data')
-rw-r--r--src/data/composite/wiki-properties/reverseContributionList.js7
-rw-r--r--src/data/things/artist.js12
2 files changed, 19 insertions, 0 deletions
diff --git a/src/data/composite/wiki-properties/reverseContributionList.js b/src/data/composite/wiki-properties/reverseContributionList.js
index 7f3f9c81..ce219377 100644
--- a/src/data/composite/wiki-properties/reverseContributionList.js
+++ b/src/data/composite/wiki-properties/reverseContributionList.js
@@ -1,4 +1,5 @@
 import {input, templateCompositeFrom} from '#composite';
+import {is} from '#validators';
 
 import {exposeDependency} from '#composite/control-flow';
 import {inputWikiData, withReverseContributionList} from '#composite/wiki-data';
@@ -11,12 +12,18 @@ export default templateCompositeFrom({
   inputs: {
     data: inputWikiData({allowMixedTypes: false}),
     list: input({type: 'string'}),
+
+    mode: input({
+      validate: is('things', 'contributions'),
+      defaultValue: 'things',
+    }),
   },
 
   steps: () => [
     withReverseContributionList({
       data: input('data'),
       list: input('list'),
+      mode: input('mode'),
     }),
 
     exposeDependency({dependency: '#reverseContributionList'}),
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index 3e4c8c2c..44fd458d 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -142,6 +142,18 @@ export class Artist extends Thing {
       list: input.value('commentatorArtists'),
     }),
 
+    artistContributions: reverseContributionList({
+      data: 'trackData',
+      list: input.value('artistContribs'),
+      mode: input.value('contributions'),
+    }),
+
+    contributorContributions: reverseContributionList({
+      data: 'trackData',
+      list: input.value('artistContribs'),
+      mode: input.value('contributions'),
+    }),
+
     albumsAsAlbumArtist: reverseContributionList({
       data: 'albumData',
       list: input.value('artistContribs'),