From 886c6d1d30b6d445193a2d3379359b31b1448834 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 15 Aug 2023 17:10:29 -0300 Subject: yaml: report unambiguous names for resolving track rereleases --- src/data/yaml.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/data/yaml.js b/src/data/yaml.js index 44bca66b..627f559c 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -1452,10 +1452,20 @@ export function filterReferenceErrors(wikiData) { // It should still be reported since the 'Originally Released As' field // was present. const original = find.track(track.originalReleaseTrackByRef, wikiData.trackData, {mode: 'quiet'}); - const shouldBeMessage = + + // Prefer references by name, but only if it's unambiguous. + const originalByName = (original + ? find.track(original.name, wikiData.trackData, {mode: 'quiet'}) + : null); + + const shouldBeMessage = + (originalByName + ? color.green(original.name) + : original ? color.green('track:' + original.directory) : color.green(track.originalReleaseTrackByRef)); + throw new Error(`Reference ${color.red(trackRef)} is to a rerelease, should be ${shouldBeMessage}`); } -- cgit 1.3.0-6-gf8a5