diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-10-03 19:21:43 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-10-03 19:22:15 -0300 |
commit | 84afb5dabf98b8822b3433baca8e02896df04048 (patch) | |
tree | 376bb783edce8d34f24e334645f822e1a1624d74 /src/data/checks.js | |
parent | 7ae1f20d46669be1e8354da1da83888de60814cc (diff) |
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.
Diffstat (limited to 'src/data/checks.js')
-rw-r--r-- | src/data/checks.js | 11 |
1 files changed, 9 insertions, 2 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. |