« get me outta code hell

data: Track: chop withHasUniqueCoverArt - 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-11-25 14:46:53 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-11-25 14:56:16 -0400
commit04589995da7ceae84aec112e44f7451e9bc47e0c (patch)
treefc8b440001f8e02597280846033e3bb89e184d2a /src/data/composite
parentc53cc385b7897bc662fa785e6569e45ac69ed7a6 (diff)
data: Track: chop withHasUniqueCoverArt
Diffstat (limited to 'src/data/composite')
-rw-r--r--src/data/composite/things/track/exitWithoutUniqueCoverArt.js6
-rw-r--r--src/data/composite/things/track/index.js1
-rw-r--r--src/data/composite/things/track/withHasUniqueCoverArt.js108
-rw-r--r--src/data/composite/things/track/withTrackArtDate.js5
4 files changed, 2 insertions, 118 deletions
diff --git a/src/data/composite/things/track/exitWithoutUniqueCoverArt.js b/src/data/composite/things/track/exitWithoutUniqueCoverArt.js
index f47086d9..54b5e2b1 100644
--- a/src/data/composite/things/track/exitWithoutUniqueCoverArt.js
+++ b/src/data/composite/things/track/exitWithoutUniqueCoverArt.js
@@ -5,8 +5,6 @@ import {input, templateCompositeFrom} from '#composite';
 
 import {exitWithoutDependency} from '#composite/control-flow';
 
-import withHasUniqueCoverArt from './withHasUniqueCoverArt.js';
-
 export default templateCompositeFrom({
   annotation: `exitWithoutUniqueCoverArt`,
 
@@ -15,10 +13,8 @@ export default templateCompositeFrom({
   },
 
   steps: () => [
-    withHasUniqueCoverArt(),
-
     exitWithoutDependency({
-      dependency: '#hasUniqueCoverArt',
+      dependency: 'hasUniqueCoverArt',
       mode: input.value('falsy'),
       value: input('value'),
     }),
diff --git a/src/data/composite/things/track/index.js b/src/data/composite/things/track/index.js
index be276d25..c7c43f4c 100644
--- a/src/data/composite/things/track/index.js
+++ b/src/data/composite/things/track/index.js
@@ -6,7 +6,6 @@ export {default as withAllReleases} from './withAllReleases.js';
 export {default as withCoverArtistContribs} from './withCoverArtistContribs.js';
 export {default as withDate} from './withDate.js';
 export {default as withDirectorySuffix} from './withDirectorySuffix.js';
-export {default as withHasUniqueCoverArt} from './withHasUniqueCoverArt.js';
 export {default as withMainRelease} from './withMainRelease.js';
 export {default as withMainReleaseTrack} from './withMainReleaseTrack.js';
 export {default as withOtherReleases} from './withOtherReleases.js';
diff --git a/src/data/composite/things/track/withHasUniqueCoverArt.js b/src/data/composite/things/track/withHasUniqueCoverArt.js
deleted file mode 100644
index c52abb98..00000000
--- a/src/data/composite/things/track/withHasUniqueCoverArt.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// Whether or not the track has "unique" cover artwork - a cover which is
-// specifically associated with this track in particular, rather than with
-// the track's album as a whole. This is typically used to select between
-// displaying the track artwork and a fallback, such as the album artwork
-// or a placeholder. (This property is named hasUniqueCoverArt instead of
-// the usual hasCoverArt to emphasize that it does not inherit from the
-// album.)
-//
-// withHasUniqueCoverArt is based only around the presence of *specified*
-// cover artist contributions, not whether the references to artists on those
-// contributions actually resolve to anything. It completely evades interacting
-// with find/replace.
-
-import {input, templateCompositeFrom} from '#composite';
-
-import {raiseOutputWithoutDependency, withResultOfAvailabilityCheck}
-  from '#composite/control-flow';
-import {fillMissingListItems, withFlattenedList, withPropertyFromList}
-  from '#composite/data';
-
-import withPropertyFromAlbum from './withPropertyFromAlbum.js';
-
-export default templateCompositeFrom({
-  annotation: 'withHasUniqueCoverArt',
-
-  outputs: ['#hasUniqueCoverArt'],
-
-  steps: () => [
-    {
-      dependencies: ['disableUniqueCoverArt'],
-      compute: (continuation, {disableUniqueCoverArt}) =>
-        (disableUniqueCoverArt
-          ? continuation.raiseOutput({
-              ['#hasUniqueCoverArt']: false,
-            })
-          : continuation()),
-    },
-
-    withResultOfAvailabilityCheck({
-      from: '_coverArtistContribs',
-      mode: input.value('empty'),
-    }),
-
-    {
-      dependencies: ['#availability'],
-      compute: (continuation, {
-        ['#availability']: availability,
-      }) =>
-        (availability
-          ? continuation.raiseOutput({
-              ['#hasUniqueCoverArt']: true,
-            })
-          : continuation()),
-    },
-
-    withPropertyFromAlbum({
-      property: input.value('trackCoverArtistContribs'),
-      internal: input.value(true),
-    }),
-
-    withResultOfAvailabilityCheck({
-      from: '#album.trackCoverArtistContribs',
-      mode: input.value('empty'),
-    }),
-
-    {
-      dependencies: ['#availability'],
-      compute: (continuation, {
-        ['#availability']: availability,
-      }) =>
-        (availability
-          ? continuation.raiseOutput({
-              ['#hasUniqueCoverArt']: true,
-            })
-          : continuation()),
-    },
-
-    raiseOutputWithoutDependency({
-      dependency: '_trackArtworks',
-      mode: input.value('empty'),
-      output: input.value({'#hasUniqueCoverArt': false}),
-    }),
-
-    withPropertyFromList({
-      list: '_trackArtworks',
-      property: input.value('artistContribs'),
-      internal: input.value(true),
-    }),
-
-    // Since we're getting the update value for each artwork's artistContribs,
-    // it may not be set at all, and in that case won't be exposing as [].
-    fillMissingListItems({
-      list: '#trackArtworks.artistContribs',
-      fill: input.value([]),
-    }),
-
-    withFlattenedList({
-      list: '#trackArtworks.artistContribs',
-    }),
-
-    withResultOfAvailabilityCheck({
-      from: '#flattenedList',
-      mode: input.value('empty'),
-    }).outputs({
-      '#availability': '#hasUniqueCoverArt',
-    }),
-  ],
-});
diff --git a/src/data/composite/things/track/withTrackArtDate.js b/src/data/composite/things/track/withTrackArtDate.js
index f524afb9..b7eff5ad 100644
--- a/src/data/composite/things/track/withTrackArtDate.js
+++ b/src/data/composite/things/track/withTrackArtDate.js
@@ -4,7 +4,6 @@ import {isDate} from '#validators';
 import {raiseOutputWithoutDependency} from '#composite/control-flow';
 
 import withDate from './withDate.js';
-import withHasUniqueCoverArt from './withHasUniqueCoverArt.js';
 import withPropertyFromAlbum from './withPropertyFromAlbum.js';
 
 export default templateCompositeFrom({
@@ -21,10 +20,8 @@ export default templateCompositeFrom({
   outputs: ['#trackArtDate'],
 
   steps: () => [
-    withHasUniqueCoverArt(),
-
     raiseOutputWithoutDependency({
-      dependency: '#hasUniqueCoverArt',
+      dependency: 'hasUniqueCoverArt',
       mode: input.value('falsy'),
       output: input.value({'#trackArtDate': null}),
     }),