From 42c3d473637e56b89acf052fcc9a9ed44515bade Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 22 May 2022 12:24:51 -0300 Subject: filter missing refs from wiki info divide field --- src/data/yaml.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit 1.3.0-6-gf8a5