« get me outta code hell

data: isOriginalRelease -> isMainRelease, etc - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/checks.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-19 16:24:14 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-03-02 08:24:12 -0400
commit76e508ffe3818a78fb941ecde05fe9c269e8bc22 (patch)
tree3dcc62ca4b91799e59dab75a4dcf535e127d5e2b /src/data/checks.js
parent2bbaa9a58728269f654e48fd9888a309ab890881 (diff)
data: isOriginalRelease -> isMainRelease, etc
Also isRerelease -> isSecondaryRelease

Im sure this is completely bug free and will not
involve squashing one million additional commits
Diffstat (limited to 'src/data/checks.js')
-rw-r--r--src/data/checks.js35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/data/checks.js b/src/data/checks.js
index ff278d36..10261e4f 100644
--- a/src/data/checks.js
+++ b/src/data/checks.js
@@ -228,11 +228,11 @@ export function filterReferenceErrors(wikiData, {
       artistContribs: '_contrib',
       contributorContribs: '_contrib',
       coverArtistContribs: '_contrib',
-      referencedTracks: '_trackNotRerelease',
-      sampledTracks: '_trackNotRerelease',
+      referencedTracks: '_trackMainReleasesOnly',
+      sampledTracks: '_trackMainReleasesOnly',
       artTags: '_artTag',
       referencedArtworks: '_artwork',
-      originalReleaseTrack: '_trackNotRerelease',
+      mainReleaseTrack: '_trackMainReleasesOnly',
       commentary: '_commentary',
     }],
 
@@ -358,29 +358,28 @@ export function filterReferenceErrors(wikiData, {
                 findFn = ref => boundFind.track(ref.reference);
                 break;
 
-              case '_trackNotRerelease':
+              case '_trackMainReleasesOnly':
                 findFn = trackRef => {
                   const track = boundFind.track(trackRef);
-                  const originalRef = track && CacheableObject.getUpdateValue(track, 'originalReleaseTrack');
+                  const mainRef = track && CacheableObject.getUpdateValue(track, 'mainReleaseTrack');
 
-                  if (originalRef) {
-                    // It's possible for the original to not actually exist, in this case.
-                    // It should still be reported since the 'Originally Released As' field
-                    // was present.
-                    const original = boundFind.track(originalRef, {mode: 'quiet'});
+                  if (mainRef) {
+                    // It's possible for the main release to not actually exist, in this case.
+                    // It should still be reported since the 'Main Release' field was present.
+                    const main = boundFind.track(mainRef, {mode: 'quiet'});
 
                     // Prefer references by name, but only if it's unambiguous.
-                    const originalByName =
-                      (original
-                        ? boundFind.track(original.name, {mode: 'quiet'})
+                    const mainByName =
+                      (main
+                        ? boundFind.track(main.name, {mode: 'quiet'})
                         : null);
 
                     const shouldBeMessage =
-                      (originalByName
-                        ? colors.green(original.name)
-                     : original
-                        ? colors.green('track:' + original.directory)
-                        : colors.green(originalRef));
+                      (mainByName
+                        ? colors.green(main.name)
+                     : main
+                        ? colors.green('track:' + main.directory)
+                        : colors.green(mainRef));
 
                     throw new Error(`Reference ${colors.red(trackRef)} is to a rerelease, should be ${shouldBeMessage}`);
                   }