« get me outta code hell

Album.groups, comment out now-useless ref resolves - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-02-16 22:07:15 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-02-16 22:07:48 -0400
commitb3695dbb8cfdd819a82c6d0eed32b5f94a0c1e51 (patch)
tree23b4781c4a055ed4f641b1a470e0ccc8c558a3e5 /src/data
parent6c27767ae2222186872803b17e6edcf8b23507db (diff)
Album.groups, comment out now-useless ref resolves
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/data/things.js b/src/data/things.js
index dd85e4a7..88110a02 100644
--- a/src/data/things.js
+++ b/src/data/things.js
@@ -363,6 +363,7 @@ Album.propertyDescriptors = {
     // Update only
 
     artistData: Thing.common.wikiData(Artist),
+    groupData: Thing.common.wikiData(Group),
     trackData: Thing.common.wikiData(Track),
 
     // Expose only
@@ -385,6 +386,21 @@ Album.propertyDescriptors = {
             )
         }
     },
+
+    groups: {
+        flags: {expose: true},
+
+        expose: {
+            dependencies: ['groupsByRef', 'groupData'],
+            compute: ({ groupsByRef, groupData }) => (
+                (groupsByRef && groupData
+                    ? (groupsByRef
+                        .map(ref => find.group(ref, {wikiData: {groupData}}))
+                        .filter(Boolean))
+                    : [])
+            )
+        }
+    },
 };
 
 TrackGroup.propertyDescriptors = {