« 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
diff options
context:
space:
mode:
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/track.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js
index bc9affbe..bf56a6dd 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -203,25 +203,15 @@ export class Track extends Thing {
       }),
 
       {
-        mapDependencies: {contribsFromTrack: '#artistContribs'},
-        compute: ({contribsFromTrack}, continuation) =>
+        dependencies: ['#artistContribs'],
+        compute: ({'#artistContribs': contribsFromTrack}, continuation) =>
           (empty(contribsFromTrack)
             ? continuation()
             : contribsFromTrack),
       },
 
       Track.composite.withAlbumProperty('artistContribs'),
-
-      {
-        flags: {expose: true},
-        expose: {
-          mapDependencies: {contribsFromAlbum: '#album.artistContribs'},
-          compute: ({contribsFromAlbum}) =>
-            (empty(contribsFromAlbum)
-              ? null
-              : contribsFromAlbum),
-        },
-      },
+      Thing.composite.exposeDependency('#album.artistContribs'),
     ]),
 
     contributorContribs: Thing.composite.from(`Track.contributorContribs`, [
@@ -247,8 +237,8 @@ export class Track extends Thing {
       }),
 
       {
-        mapDependencies: {contribsFromTrack: '#coverArtistContribs'},
-        compute: ({contribsFromTrack}, continuation) =>
+        dependencies: ['#coverArtistContribs'],
+        compute: ({'#coverArtistContribs': contribsFromTrack}, continuation) =>
           (empty(contribsFromTrack)
             ? continuation()
             : contribsFromTrack),