« get me outta code hell

data: use soupyFind everywhere - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/yaml.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-01-11 00:11:37 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-11 00:11:37 -0400
commit9d99dafca9dc4e16b867b707746314040a8d9ba5 (patch)
tree6928b4efcaeac5508d06c74ac3bfeefce0ce4b7d /src/data/yaml.js
parent8bbd9ac0b5cf8cc64ccbae7ae16b23f05d93d880 (diff)
data: use soupyFind everywhere
also notes where remaining directly-provided wikiData() props
are used
Diffstat (limited to 'src/data/yaml.js')
-rw-r--r--src/data/yaml.js32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 2420bf71..cb16f872 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1227,11 +1227,11 @@ export async function loadAndProcessDataDocuments(dataSteps, {dataPath}) {
 // of which are required for page HTML generation and other expected behavior).
 export function linkWikiDataArrays(wikiData, {bindFind}) {
   const linkWikiDataSpec = new Map([
+    // entries must be present here even without any properties to explicitly
+    // link if the 'find' property will be implicitly linked
+
     [wikiData.albumData, [
       'albumData',
-      'artTagData',
-      'artistData',
-      'groupData',
       'trackData',
       'wikiInfo',
     ]],
@@ -1243,47 +1243,33 @@ export function linkWikiDataArrays(wikiData, {bindFind}) {
 
     [wikiData.artistData, [
       'albumData',
-      'artistData',
       'flashData',
       'groupData',
       'trackData',
     ]],
 
     [wikiData.flashData, [
-      'artistData',
       'flashActData',
-      'trackData',
       'wikiInfo',
     ]],
 
     [wikiData.flashActData, [
-      'flashData',
       'flashSideData',
     ]],
 
-    [wikiData.flashSideData, [
-      'flashActData',
-    ]],
+    [wikiData.flashSideData, [/* find */]],
 
     [wikiData.groupData, [
       'albumData',
-      'artistData',
       'groupCategoryData',
     ]],
 
-    [wikiData.groupCategoryData, [
-      'groupData',
-    ]],
+    [wikiData.groupCategoryData, [/* find */]],
 
-    [wikiData.homepageLayout?.rows, [
-      'albumData',
-      'groupData',
-    ]],
+    [wikiData.homepageLayout.rows, [/* find */]],
 
     [wikiData.trackData, [
       'albumData',
-      'artTagData',
-      'artistData',
       'flashData',
       'trackData',
       'trackSectionData',
@@ -1294,14 +1280,14 @@ export function linkWikiDataArrays(wikiData, {bindFind}) {
       'albumData',
     ]],
 
-    [[wikiData.wikiInfo], [
-      'groupData',
-    ]],
+    [[wikiData.wikiInfo], [/* find */]],
   ]);
 
   const constructorHasFindMap = new Map();
   const boundFind = bindFind(wikiData);
 
+  for (const thing of Object.values(wikiData).flat());
+
   for (const [things, keys] of linkWikiDataSpec.entries()) {
     if (things === undefined) continue;