« get me outta code hell

data: Track.isOriginalRelease, Track.isRerelease - 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-06 14:24:15 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:36 -0300
commitdc577200fc6c469fdc972f4d00216e41b7e51024 (patch)
tree65f9680081b473004cf3e52205b20ddeb2d65530 /src/data/things
parent53155b27531b8d2ad51745228399a236ea7cf435 (diff)
data: Track.isOriginalRelease, Track.isRerelease
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/track.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js
index eda68a4e..3ead059a 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -27,6 +27,7 @@ import {
   exposeDependency,
   exposeDependencyOrContinue,
   exposeUpdateValueOrContinue,
+  exposeWhetherDependencyAvailable,
 } from '#composite/control-flow';
 
 import {
@@ -62,6 +63,7 @@ import {
   withAlwaysReferenceByDirectory,
   withContainingTrackSection,
   withHasUniqueCoverArt,
+  withOriginalRelease,
   withOtherReleases,
   withPropertyFromAlbum,
 } from '#composite/things/track';
@@ -348,6 +350,23 @@ export class Track extends Thing {
       exposeDependency({dependency: '#hasUniqueCoverArt'}),
     ],
 
+    isOriginalRelease: [
+      withOriginalRelease(),
+
+      exposeWhetherDependencyAvailable({
+        dependency: '#originalRelease',
+        negate: input.value(true),
+      }),
+    ],
+
+    isRerelease: [
+      withOriginalRelease(),
+
+      exposeWhetherDependencyAvailable({
+        dependency: '#originalRelease',
+      }),
+    ],
+
     otherReleases: [
       withOtherReleases(),
       exposeDependency({dependency: '#otherReleases'}),