« get me outta code hell

data: Track: chop withCoverArtistContribs - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/track.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-11-25 15:17:44 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-11-25 15:17:44 -0400
commite8506a51537f7e2cf36dcf95a81984c9f68a2364 (patch)
tree05fc6b55592a364d94d1fc4b27408eb7b2a0b276 /src/data/things/track.js
parent44130f9e14852302ddbd4418229568b514253276 (diff)
data: Track: chop withCoverArtistContribs
Diffstat (limited to 'src/data/things/track.js')
-rw-r--r--src/data/things/track.js37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 798f3ca3..8ae4864d 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -82,7 +82,6 @@ import {
   inheritContributionListFromMainRelease,
   inheritFromMainRelease,
   withAllReleases,
-  withCoverArtistContribs,
   withDirectorySuffix,
   withMainRelease,
   withMainReleaseTrack,
@@ -350,13 +349,39 @@ export class Track extends Thing {
     ],
 
     coverArtistContribs: [
-      withCoverArtistContribs({
-        from: input.updateValue({
-          validate: isContributionList,
-        }),
+      exitWithoutUniqueCoverArt({
+        value: input.value([]),
+      }),
+
+      withResolvedContribs({
+        from: input.updateValue({validate: isContributionList}),
+        thingProperty: input.value('coverArtistContribs'),
+        artistProperty: input.value('trackCoverArtistContributions'),
+        date: 'coverArtDate',
+      }),
+
+      exposeDependencyOrContinue({
+        dependency: '#resolvedContribs',
+        mode: input.value('empty'),
       }),
 
-      exposeDependency({dependency: '#coverArtistContribs'}),
+      withPropertyFromAlbum({
+        property: input.value('trackCoverArtistContribs'),
+      }),
+
+      withRecontextualizedContributionList({
+        list: '#album.trackCoverArtistContribs',
+        artistProperty: input.value('trackCoverArtistContributions'),
+      }),
+
+      withRedatedContributionList({
+        list: '#album.trackCoverArtistContribs',
+        date: 'coverArtDate',
+      }),
+
+      exposeDependency({
+        dependency: '#album.trackCoverArtistContribs',
+      }),
     ],
 
     coverArtDate: [