« get me outta code hell

data: draft art tags Two - 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>2023-10-02 16:59:30 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-02 17:32:06 -0300
commit9694750ef41c420b0fd419b230d79d5ed1149a76 (patch)
treefb4bc3c9d1e512f0f10342c5e31ae2b1a092a6a7 /src/data
parent97d9a13846654b8fa5b7520254f0f5ebc575305b (diff)
data: draft art tags Two
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/art-tag.js17
-rw-r--r--src/data/yaml.js8
2 files changed, 23 insertions, 2 deletions
diff --git a/src/data/things/art-tag.js b/src/data/things/art-tag.js
index 1266a4e0..f6798214 100644
--- a/src/data/things/art-tag.js
+++ b/src/data/things/art-tag.js
@@ -1,6 +1,7 @@
 import {input} from '#composite';
-import {sortAlbumsTracksChronologically} from '#wiki-data';
+import find from '#find';
 import {isName} from '#validators';
+import {sortAlbumsTracksChronologically} from '#wiki-data';
 
 import {exposeUpdateValueOrContinue} from '#composite/control-flow';
 
@@ -8,6 +9,8 @@ import {
   color,
   directory,
   flag,
+  referenceList,
+  reverseReferenceList,
   name,
   wikiData,
 } from '#composite/wiki-properties';
@@ -37,9 +40,16 @@ export class ArtTag extends Thing {
       },
     ],
 
+    directDescendantTags: referenceList({
+      class: input.value(ArtTag),
+      find: input.value(find.artTag),
+      data: 'artTagData',
+    }),
+
     // Update only
 
     albumData: wikiData(Album),
+    artTagData: wikiData(ArtTag),
     trackData: wikiData(Track),
 
     // Expose only
@@ -56,5 +66,10 @@ export class ArtTag extends Thing {
             {getDate: o => o.coverArtDate}),
       },
     },
+
+    directAncestorTags: reverseReferenceList({
+      data: 'artTagData',
+      list: input.value('directDescendantTags'),
+    }),
   });
 }
diff --git a/src/data/yaml.js b/src/data/yaml.js
index c799be5f..8a5cb2ca 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -462,6 +462,8 @@ export const processArtTagDocument = makeProcessDocument(T.ArtTag, {
 
     color: 'Color',
     isContentWarning: 'Is CW',
+
+    directDescendantTags: 'Direct Descendant Tags',
   },
 });
 
@@ -1359,7 +1361,7 @@ export function linkWikiDataArrays(wikiData, {
   assignWikiData(WD.groupCategoryData, 'groupData');
   assignWikiData(WD.flashData, 'artistData', 'flashActData', 'trackData');
   assignWikiData(WD.flashActData, 'flashData');
-  assignWikiData(WD.artTagData, 'albumData', 'trackData');
+  assignWikiData(WD.artTagData, 'albumData', 'artTagData', 'trackData');
   assignWikiData(WD.homepageLayout?.rows, 'albumData', 'groupData');
 }
 
@@ -1477,6 +1479,10 @@ export function filterReferenceErrors(wikiData) {
       artTags: 'artTag',
     }],
 
+    ['artTagData', processArtTagDocument, {
+      directDescendantTags: 'artTag',
+    }],
+
     ['trackData', processTrackDocument, {
       artistContribs: '_contrib',
       contributorContribs: '_contrib',