« get me outta code hell

data, checks: don't let Main Release be secrelease's own album - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-10-03 19:19:43 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-10-03 19:19:43 -0300
commit7ae1f20d46669be1e8354da1da83888de60814cc (patch)
treeabdea7f9ab9f713d418791b48d966c239213cfec /src/data/composite
parent590acab709aca1c9ded2feb6de8d170de554340b (diff)
data, checks: don't let Main Release be secrelease's own album
Diffstat (limited to 'src/data/composite')
-rw-r--r--src/data/composite/things/track/withMainReleaseTrack.js14
-rw-r--r--src/data/composite/things/track/withPropertyFromMainRelease.js2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/data/composite/things/track/withMainReleaseTrack.js b/src/data/composite/things/track/withMainReleaseTrack.js
index 871eba7d..e498582d 100644
--- a/src/data/composite/things/track/withMainReleaseTrack.js
+++ b/src/data/composite/things/track/withMainReleaseTrack.js
@@ -203,5 +203,19 @@ export default templateCompositeFrom({
           null,
       }),
     },
+
+    {
+      dependencies: ['#mainReleaseTrack', input.myself()],
+
+      compute: (continuation, {
+        ['#mainReleaseTrack']: mainReleaseTrack,
+        [input.myself()]: thisTrack,
+      }) => continuation({
+        ['#mainReleaseTrack']:
+          (mainReleaseTrack === thisTrack
+            ? null
+            : mainReleaseTrack),
+      }),
+    },
   ],
 });
diff --git a/src/data/composite/things/track/withPropertyFromMainRelease.js b/src/data/composite/things/track/withPropertyFromMainRelease.js
index 3e1b6d19..c6f65653 100644
--- a/src/data/composite/things/track/withPropertyFromMainRelease.js
+++ b/src/data/composite/things/track/withPropertyFromMainRelease.js
@@ -13,7 +13,7 @@ import {withPropertyFromObject} from '#composite/data';
 import withMainReleaseTrack from './withMainReleaseTrack.js';
 
 export default templateCompositeFrom({
-  annotation: `inheritFromMainRelease`,
+  annotation: `withPropertyFromMainRelease`,
 
   inputs: {
     property: input({type: 'string'}),