« 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/track.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things/track.js')
-rw-r--r--src/data/things/track.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 62333136..798f3ca3 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -89,7 +89,6 @@ import {
   withOtherReleases,
   withPropertyFromAlbum,
   withSuffixDirectoryFromAlbum,
-  withTrackArtDate,
   withTrackNumber,
 } from '#composite/things/track';
 
@@ -361,13 +360,26 @@ export class Track extends Thing {
     ],
 
     coverArtDate: [
-      withTrackArtDate({
-        from: input.updateValue({
-          validate: isDate,
-        }),
+      exitWithoutDependency({
+        dependency: 'hasUniqueCoverArt',
+        mode: input.value('falsy'),
       }),
 
-      exposeDependency({dependency: '#trackArtDate'}),
+      exposeUpdateValueOrContinue({
+        validate: input.value(isDate),
+      }),
+
+      withPropertyFromAlbum({
+        property: input.value('trackArtDate'),
+      }),
+
+      exposeDependencyOrContinue({
+        dependency: '#album.trackArtDate',
+      }),
+
+      exposeDependency({
+        dependency: 'date',
+      }),
     ],
 
     coverArtFileExtension: [