« get me outta code hell

filter missing refs from wiki info divide field - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-22 12:24:51 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-22 12:24:51 -0300
commit42c3d473637e56b89acf052fcc9a9ed44515bade (patch)
tree3b15fc385073753c32fbe4dc449d5918a0d57ba5
parentf6bd91ea9beef64e0ff0865560219a64a367bb5b (diff)
filter missing refs from wiki info divide field
-rw-r--r--src/data/yaml.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index fa967561..010fce4c 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1189,6 +1189,10 @@ export function filterDuplicateDirectories(wikiData) {
 // data array.
 export function filterReferenceErrors(wikiData) {
     const referenceSpec = [
+        ['wikiInfo', {
+            divideTrackListsByGroupsByRef: 'group',
+        }],
+
         ['albumData', {
             artistContribsByRef: '_contrib',
             coverArtistContribsByRef: '_contrib',
@@ -1240,7 +1244,8 @@ export function filterReferenceErrors(wikiData) {
     for (const [ thingDataProp, propSpec ] of referenceSpec) {
         const thingData = getNestedProp(wikiData, thingDataProp);
         aggregate.nest({message: `Reference errors in ${color.green('wikiData.' + thingDataProp)}`}, ({ nest }) => {
-            for (const thing of thingData) {
+            const things = Array.isArray(thingData) ? thingData : [thingData];
+            for (const thing of things) {
                 nest({message: `Reference errors in ${inspect(thing)}`}, ({ filter }) => {
                     for (const [ property, findFnKey ] of Object.entries(propSpec)) {
                         if (!thing[property]) continue;