« get me outta code hell

checks: filterReferenceErrors: _include - 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>2025-02-11 10:45:46 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-02-12 07:43:59 -0400
commit7ee12e72ae59f06dcde10f330dbfd023ae04709d (patch)
tree986c0d5f663892d318ab387637c98ba1dd8d719c /src/data
parentea4cd3278454f6ff4bd869de1fd44eef42f0476b (diff)
checks: filterReferenceErrors: _include
Diffstat (limited to 'src/data')
-rw-r--r--src/data/checks.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/data/checks.js b/src/data/checks.js
index 6a890f34..e8a83c61 100644
--- a/src/data/checks.js
+++ b/src/data/checks.js
@@ -197,6 +197,7 @@ export function filterReferenceErrors(wikiData, {
     }],
 
     ['homepageLayout.sections.rows', {
+      _include: row => row.type === 'albums',
       sourceGroup: '_homepageSourceGroup',
       sourceAlbums: 'album',
     }],
@@ -244,8 +245,16 @@ export function filterReferenceErrors(wikiData, {
 
     aggregate.nest({message: `Reference errors in ${colors.green('wikiData.' + thingDataProp)}`}, ({nest}) => {
       for (const thing of things) {
+        if (propSpec._include && !propSpec._include(thing)) {
+          continue;
+        }
+
         nest({message: `Reference errors in ${inspect(thing)}`}, ({nest, push, filter}) => {
           for (const [property, findFnKey] of Object.entries(propSpec)) {
+            if (property === '_include') {
+              continue;
+            }
+
             let value = CacheableObject.getUpdateValue(thing, property);
             let writeProperty = true;