From bc5e4e37be8b66d99083f26ff0e8b79edf2aa663 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 2 Oct 2025 20:46:56 -0300 Subject: checks: check resolved mainReleaseTrack, too --- src/data/checks.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/data/checks.js b/src/data/checks.js index edfd7e5b..5688b979 100644 --- a/src/data/checks.js +++ b/src/data/checks.js @@ -379,8 +379,24 @@ export function filterReferenceErrors(wikiData, { } } - if (track ?? album) { - return track ?? album; + if (track) { + return track; + } + + if (album) { + // At this point verification depends on the thing itself, + // which is currently in lexical scope, but if this code + // gets refactored, there might be trouble here... + + if (thing.mainReleaseTrack === null) { + throw new Error( + `Matched album for reference "${ref}":\n` + + `- ` + inspect(album) + `\n` + + `...but none of its tracks automatically match this secondary release.\n` + + `Please resolve by specifying the track here, instead of the album.`); + } else { + return album; + } } const aggregateCause = -- cgit 1.3.0-6-gf8a5