diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-28 13:04:32 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-28 13:04:32 -0400 |
commit | 084b5423d2a4fc60a91dd4aeb24ff0cd4d870fbc (patch) | |
tree | e7afeb209061ffa8d2a7e259ed21173e8d735dae /src/data | |
parent | e3358d7c6993aa454019ebf58a53198b9e28087f (diff) |
data: tweak track album messaging in errors/inspect
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/things/track.js | 13 | ||||
-rw-r--r-- | src/data/yaml.js | 3 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/data/things/track.js b/src/data/things/track.js index f6320677..d25213c2 100644 --- a/src/data/things/track.js +++ b/src/data/things/track.js @@ -331,12 +331,21 @@ export class Track extends Thing { } let album; - if (depth >= 0 && (album = this.album ?? this.dataSourceAlbum)) { + + if (depth >= 0) { + try { + album = this.album; + } catch (_error) {} + + album ??= this.dataSourceAlbum; + } + + if (album) { const albumName = album.name; const albumIndex = album.tracks.indexOf(this); const trackNum = (albumIndex === -1 - ? '#?' + ? 'indeterminate position' : `#${albumIndex + 1}`); parts.push(` (${colors.yellow(trackNum)} in ${colors.green(albumName)})`); } diff --git a/src/data/yaml.js b/src/data/yaml.js index dda06949..27d8721f 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -1625,8 +1625,7 @@ export function filterDuplicateDirectories(wikiData) { call(() => { throw new Error( `Duplicate directory ${colors.green(directory)}:\n` + - places.map((thing) => ` - ` + inspect(thing)).join('\n') - ); + places.map(thing => ` - ` + inspect(thing)).join('\n')); }); } |