« get me outta code hell

data: track: withTrackArtDate - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-07 11:59:42 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:39 -0300
commitcfba7bd620eda4fdcfa0c500038adaa214710766 (patch)
tree084b9dd7ae3c4d6b59672078f64815eefdbc28b2 /src/data/things
parent89e73c133d66a868c73c4ef0bac3e0aef67e6c26 (diff)
data: track: withTrackArtDate
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/track.js24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js
index d9254196..57d2ed20 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -67,6 +67,7 @@ import {
   withOriginalRelease,
   withOtherReleases,
   withPropertyFromAlbum,
+  withTrackArtDate,
 } from '#composite/things/track';
 
 export class Track extends Thing {
@@ -149,27 +150,14 @@ export class Track extends Thing {
       }),
     ],
 
-    // Date of cover art release. Like coverArtFileExtension, this represents
-    // only the track's own unique cover artwork, if any. This exposes only as
-    // the track's own coverArtDate or its album's trackArtDate, so if neither
-    // is specified, this value is null.
     coverArtDate: [
-      withHasUniqueCoverArt(),
-
-      exitWithoutDependency({
-        dependency: '#hasUniqueCoverArt',
-        mode: input.value('falsy'),
-      }),
-
-      exposeUpdateValueOrContinue({
-        validate: input.value(isDate),
-      }),
-
-      withPropertyFromAlbum({
-        property: input.value('trackArtDate'),
+      withTrackArtDate({
+        from: input.updateValue({
+          validate: isDate,
+        }),
       }),
 
-      exposeDependency({dependency: '#album.trackArtDate'}),
+      exposeDependency({dependency: '#trackArtDate'}),
     ],
 
     coverArtDimensions: [