« get me outta code hell

data: custom _homepageSourceGroup reference validation function - 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-09-07 17:23:54 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-07 17:23:54 -0300
commita24a72339f6e6e416a797d869fe9c4d9057fcac0 (patch)
tree5fca08fd511a2842c7f8d49288cc83515e931e85 /src/data
parent9db4b91c66f8b9b98d098bfe446e29f5b3caee53 (diff)
data: custom _homepageSourceGroup reference validation function
Diffstat (limited to 'src/data')
-rw-r--r--src/data/yaml.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index c0aad943..8aca3299 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1490,7 +1490,7 @@ export function filterReferenceErrors(wikiData) {
     }],
 
     ['homepageLayout.rows', undefined, {
-      sourceGroupByRef: 'group',
+      sourceGroupByRef: '_homepageSourceGroup',
       sourceAlbumsByRef: 'album',
     }],
 
@@ -1560,6 +1560,16 @@ export function filterReferenceErrors(wikiData) {
                 };
                 break;
 
+              case '_homepageSourceGroup':
+                findFn = groupRef => {
+                  if (groupRef === 'new-additions' || groupRef === 'new-releases') {
+                    return true;
+                  }
+
+                  return boundFind.group(groupRef);
+                };
+                break;
+
               case '_trackNotRerelease':
                 findFn = trackRef => {
                   const track = find.track(trackRef, wikiData.trackData, {mode: 'error'});