From 84afb5dabf98b8822b3433baca8e02896df04048 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 3 Oct 2025 19:21:43 -0300 Subject: data, checks: Track.{referenced,sampled}Tracks: main releases only Cheats a degree of immunity to secrelease shenanigans by making (musical) track references universally *never* point to a track with a "Main Release" field (i.e. a seconday release). Still, #checks continues to detect and error when you're really pointing to a secondary release, and shouldn't be doing that. --- src/data/checks.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/data/checks.js') 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. -- cgit 1.3.0-6-gf8a5