« 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/Artist.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things/Artist.js')
-rw-r--r--src/data/things/Artist.js33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/data/things/Artist.js b/src/data/things/Artist.js
index f518e31e..b82ef8bf 100644
--- a/src/data/things/Artist.js
+++ b/src/data/things/Artist.js
@@ -14,8 +14,10 @@ import {
 
 import {exitWithoutDependency, exposeConstant, exposeDependency}
   from '#composite/control-flow';
-import {withFilteredList, withPropertyFromList} from '#composite/data';
-import {withContributionListSums} from '#composite/wiki-data';
+import {withFilteredList, withMappedList, withPropertyFromList}
+  from '#composite/data';
+import {withContributionListSums, withReverseReferenceList}
+  from '#composite/wiki-data';
 
 import {
   constitutibleArtwork,
@@ -216,6 +218,33 @@ export class Artist extends Thing {
       reverse: soupyReverse.input('musicVideoContributorContributionsBy'),
     }),
 
+    otherMusicVideoArtistContributionsToOwnAlbums: [
+      withReverseReferenceList({
+        reverse: soupyReverse.input('musicVideoArtistContributionsToAlbumsBy'),
+      }).outputs({
+        '#reverseReferenceList': '#allArtistContributions',
+      }),
+
+      {
+        dependencies: [input.myself()],
+        compute: (continuation, {
+          [input.myself()]: myself,
+        }) => continuation({
+          ['#isNotMyself']: artist => artist !== myself,
+        }),
+      },
+
+      withPropertyFromList('#allArtistContributions', V('artist')),
+
+      withMappedList('#allArtistContributions.artist', '#isNotMyself')
+        .outputs({'#mappedList': '#differentArtistFilter'}),
+
+      withFilteredList('#allArtistContributions', '#differentArtistFilter')
+        .outputs({'#filteredList': '#otherArtistContributions'}),
+
+      exposeDependency('#otherArtistContributions'),
+    ],
+
     totalDuration: [
       withPropertyFromList('musicContributions', V('thing')),
       withPropertyFromList('#musicContributions.thing', V('isMainRelease')),