« get me outta code hell

data: "This Album Only" field for additional names - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-10-30 15:41:50 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-10-30 16:04:28 -0300
commit859d1777a4f6f6d583466aaf72357d4d611f3909 (patch)
treecada415b97c507379c5b14c3147599c070de8aaa /src/data/composite/things
parentf5f21156d205a1ad8533a717e5552707d26551a2 (diff)
data: "This Album Only" field for additional names
Diffstat (limited to 'src/data/composite/things')
-rw-r--r--src/data/composite/things/track/sharedAdditionalNameList.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/data/composite/things/track/sharedAdditionalNameList.js b/src/data/composite/things/track/sharedAdditionalNameList.js
index 1806ec80..28c04101 100644
--- a/src/data/composite/things/track/sharedAdditionalNameList.js
+++ b/src/data/composite/things/track/sharedAdditionalNameList.js
@@ -4,7 +4,12 @@ import {input, templateCompositeFrom} from '#composite';
 
 import {exitWithoutDependency, exposeDependency}
   from '#composite/control-flow';
-import {withFlattenedList, withPropertyFromList} from '#composite/data';
+
+import {
+  withFilteredList,
+  withFlattenedList,
+  withPropertyFromList,
+} from '#composite/data';
 
 import withOtherReleases from './withOtherReleases.js';
 
@@ -29,10 +34,25 @@ export default templateCompositeFrom({
 
     withFlattenedList({
       list: '#otherReleases.additionalNames',
+    }).outputs({
+      ['#flattenedList']: '#otherReleaseEntries',
+    }),
+
+    withPropertyFromList({
+      list: '#otherReleaseEntries',
+      property: input.value('specificAlbumExclusive'),
+    }),
+
+    // Filter out entries that have been marked as exclusive to the containing
+    // album.
+    withFilteredList({
+      list: '#otherReleaseEntries',
+      filter: '#otherReleaseEntries.specificAlbumExclusive',
+      flip: input.value(true),
     }),
 
     exposeDependency({
-      dependency: '#flattenedList',
+      dependency: '#filteredList',
     }),
   ],
 });