« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/data/checks.js11
-rw-r--r--src/data/things/track.js4
2 files changed, 11 insertions, 4 deletions
diff --git a/src/data/checks.js b/src/data/checks.js
index de433de4..81cbd9a4 100644
--- a/src/data/checks.js
+++ b/src/data/checks.js
@@ -442,9 +442,16 @@ export function filterReferenceErrors(wikiData, {
 
               case '_trackMainReleasesOnly':
                 findFn = trackRef => {
-                  const track = boundFind.track(trackRef);
-                  const mainRef = track && CacheableObject.getUpdateValue(track, 'mainRelease');
+                  let track = boundFind.trackMainReleasesOnly(trackRef, {mode: 'quiet'});
+                  if (track) {
+                    return track;
+                  }
+
+                  // Will error normally, if this can't unambiguously resolve
+                  // or doesn't match any track.
+                  track = boundFind.track(trackRef);
 
+                  const mainRef = CacheableObject.getUpdateValue(track, 'mainRelease');
                   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.
diff --git a/src/data/things/track.js b/src/data/things/track.js
index 110769e0..1871e86b 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -398,7 +398,7 @@ export class Track extends Thing {
 
       referenceList({
         class: input.value(Track),
-        find: soupyFind.input('track'),
+        find: soupyFind.input('trackMainReleasesOnly'),
       }),
     ],
 
@@ -409,7 +409,7 @@ export class Track extends Thing {
 
       referenceList({
         class: input.value(Track),
-        find: soupyFind.input('track'),
+        find: soupyFind.input('trackMainReleasesOnly'),
       }),
     ],