« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things.js')
-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 dd85e4a..88110a0 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 = {