diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-10-02 20:46:56 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-10-02 20:47:13 -0300 |
commit | bc5e4e37be8b66d99083f26ff0e8b79edf2aa663 (patch) | |
tree | 35b800832c2c1994197faed206b911f52cc32ad9 /src/data | |
parent | ca412ca52b1998fe715951309d3e0546560c2c58 (diff) |
checks: check resolved mainReleaseTrack, too preview
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/checks.js | 20 |
1 files 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 = |