« get me outta code hell

data: Closely Linked Artists - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-11-16 12:08:32 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-11-17 13:39:53 -0400
commita618ec62bb07a0037e9431b2d7fda0ea55c29881 (patch)
tree2723ddeb9135257f0e216b3533563d2a9358df2c /src
parent226c316f21a8fb7eb5ca549221c3da0473ca5d9d (diff)
data: Closely Linked Artists
Diffstat (limited to 'src')
-rw-r--r--src/data/things/artist.js11
-rw-r--r--src/data/things/group.js14
-rw-r--r--src/data/yaml.js2
3 files changed, 25 insertions, 2 deletions
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index 6d5e33c0..8ac370c2 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -34,7 +34,7 @@ export class Artist extends Thing {
   static [Thing.referenceType] = 'artist';
   static [Thing.wikiDataArray] = 'artistData';
 
-  static [Thing.getPropertyDescriptors] = ({Album, Flash, Track}) => ({
+  static [Thing.getPropertyDescriptors] = ({Album, Flash, Group, Track}) => ({
     // Update & expose
 
     name: name('Unnamed Artist'),
@@ -74,6 +74,10 @@ export class Artist extends Thing {
       class: input.value(Flash),
     }),
 
+    groupData: wikiData({
+      class: input.value(Group),
+    }),
+
     trackData: wikiData({
       class: input.value(Track),
     }),
@@ -135,6 +139,11 @@ export class Artist extends Thing {
       list: input.value('commentatorArtists'),
     }),
 
+    closelyLinkedGroups: reverseReferenceList({
+      data: 'groupData',
+      list: input.value('closelyLinkedArtists'),
+    }),
+
     totalDuration: artistTotalDuration(),
   });
 
diff --git a/src/data/things/group.js b/src/data/things/group.js
index e000e407..06791ccc 100644
--- a/src/data/things/group.js
+++ b/src/data/things/group.js
@@ -19,7 +19,7 @@ import {
 export class Group extends Thing {
   static [Thing.referenceType] = 'group';
 
-  static [Thing.getPropertyDescriptors] = ({Album}) => ({
+  static [Thing.getPropertyDescriptors] = ({Album, Artist}) => ({
     // Update & expose
 
     name: name('Unnamed Group'),
@@ -29,6 +29,12 @@ export class Group extends Thing {
 
     urls: urls(),
 
+    closelyLinkedArtists: referenceList({
+      class: input.value(Artist),
+      find: input.value(find.artist),
+      data: 'artistData',
+    }),
+
     featuredAlbums: referenceList({
       class: input.value(Album),
       find: input.value(find.album),
@@ -45,6 +51,10 @@ export class Group extends Thing {
       class: input.value(Album),
     }),
 
+    artistData: wikiData({
+      class: input.value(Artist),
+    }),
+
     groupCategoryData: wikiData({
       class: input.value(GroupCategory),
     }),
@@ -110,6 +120,8 @@ export class Group extends Thing {
       'Description': {property: 'description'},
       'URLs': {property: 'urls'},
 
+      'Closely Linked Artists': {property: 'closelyLinkedArtists'},
+
       'Featured Albums': {property: 'featuredAlbums'},
 
       'Series': {
diff --git a/src/data/yaml.js b/src/data/yaml.js
index b2143625..1218a8a0 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1224,6 +1224,7 @@ export function linkWikiDataArrays(wikiData) {
       'albumData',
       'artistData',
       'flashData',
+      'groupData',
       'trackData',
     ]],
 
@@ -1245,6 +1246,7 @@ export function linkWikiDataArrays(wikiData) {
 
     [wikiData.groupData, [
       'albumData',
+      'artistData',
       'groupCategoryData',
     ]],