« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/data/things/track.js36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js
index f07bba82..298cd6cf 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -225,40 +225,8 @@ export class Track extends Thing {
       }),
 
       exposeDependencyOrContinue('#sameNameSingle'),
-
-      {
-        dependencies: [
-          '#matchingTrack',
-          '#matchingAlbum',
-        ],
-
-        compute: (continuation, {
-          ['#matchingTrack']: matchingTrack,
-          ['#matchingAlbum']: matchingAlbum,
-        }) =>
-          (matchingTrack && matchingAlbum
-            ? continuation()
-         : matchingTrack ?? matchingAlbum
-            ? matchingTrack ?? matchingAlbum
-            : null),
-      },
-
-      withPropertyFromObject( '#matchingAlbum', V('tracks')),
-
-      {
-        dependencies: [
-          '#matchingAlbum.tracks',
-          '#matchingTrack',
-        ],
-
-        compute: ({
-          ['#matchingAlbum.tracks']: matchingAlbumTracks,
-          ['#matchingTrack']: matchingTrack,
-        }) =>
-          (matchingAlbumTracks.includes(matchingTrack)
-            ? matchingTrack
-            : null),
-      },
+      exposeDependencyOrContinue('#matchingAlbum'),
+      exposeDependency('#matchingTrack'),
     ],
 
     bandcampTrackIdentifier: simpleString(),