« get me outta code hell

data: Track: withHasUniqueCoverArt: process direct links only - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/track/withPropertyFromAlbum.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-04-06 15:44:16 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-04-10 16:02:39 -0300
commite8670dd43d70ef91df6dc1164d11397de639e3b8 (patch)
tree052d3297e549a2368fb9300688d8f4042796e255 /src/data/composite/things/track/withPropertyFromAlbum.js
parentf02db61b1da6b6a79a16550d9217cb3e1473ef98 (diff)
data: Track: withHasUniqueCoverArt: process direct links only
No soupyFind/soupyReverse.

This commit introduces a notion of difference between
an artwork which is 'declared to exist' via, say, having
cover artists, versus one which... is 'usable', because it
has resolved cover artists. No other code addressing this
yet, so it's in a tense state where existence is in every
case according to declared cover artists, whether or not
those cover artist references resolve.
Diffstat (limited to 'src/data/composite/things/track/withPropertyFromAlbum.js')
-rw-r--r--src/data/composite/things/track/withPropertyFromAlbum.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/data/composite/things/track/withPropertyFromAlbum.js b/src/data/composite/things/track/withPropertyFromAlbum.js
index 311a3448..a203c2e7 100644
--- a/src/data/composite/things/track/withPropertyFromAlbum.js
+++ b/src/data/composite/things/track/withPropertyFromAlbum.js
@@ -10,6 +10,7 @@ export default templateCompositeFrom({
 
   inputs: {
     property: input.staticValue({type: 'string'}),
+    internal: input({type: 'boolean', defaultValue: false}),
   },
 
   outputs: ({
@@ -17,10 +18,21 @@ export default templateCompositeFrom({
   }) => ['#album.' + property],
 
   steps: () => [
+    // XXX: This is a ridiculous hack considering `defaultValue` above.
+    // If we were certain what was up, we'd just get around to fixing it LOL
+    {
+      dependencies: [input('internal')],
+      compute: (continuation, {
+        [input('internal')]: internal,
+      }) => continuation({
+        ['#internal']: internal ?? false,
+      }),
+    },
 
     withPropertyFromObject({
       object: 'album',
       property: input('property'),
+      internal: '#internal',
     }),
 
     {