diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-04-13 09:12:39 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-04-13 09:12:39 -0300 |
| commit | 34714ebea5d11289ea3013819e40a5b86e1b7f72 (patch) | |
| tree | ac37fb11aa3a7b6b5265b1713a1e2cc353b4f10e /src/data/things | |
| parent | 584dc0aa02cd0f586b2917eccb5d62fd73abdc3b (diff) | |
data: Thing.inspectReference & friends preview
Diffstat (limited to 'src/data/things')
| -rw-r--r-- | src/data/things/Artwork.js | 2 | ||||
| -rw-r--r-- | src/data/things/MusicVideo.js | 2 | ||||
| -rw-r--r-- | src/data/things/contrib/Contribution.js | 14 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/data/things/Artwork.js b/src/data/things/Artwork.js index 7beb3567..d2bd31ba 100644 --- a/src/data/things/Artwork.js +++ b/src/data/things/Artwork.js @@ -422,7 +422,7 @@ export class Artwork extends Thing { parts.push(` for ${inspect(this.thing, newOptions)}`); } else { - parts.push(` for ${colors.blue(Thing.getReference(this.thing))}`); + parts.push(` for ${Thing.inspectReference(this.thing)}`); } } diff --git a/src/data/things/MusicVideo.js b/src/data/things/MusicVideo.js index 3a41caf5..8ca7c813 100644 --- a/src/data/things/MusicVideo.js +++ b/src/data/things/MusicVideo.js @@ -193,7 +193,7 @@ export class MusicVideo extends Thing { parts.push(` for ${inspect(this.thing, newOptions)}`); } else { - parts.push(` for ${colors.blue(Thing.getReference(this.thing))}`); + parts.push(` for ${colors.blue(Thing.inspectReference(this.thing))}`); } } diff --git a/src/data/things/contrib/Contribution.js b/src/data/things/contrib/Contribution.js index 4352b58a..305e6a14 100644 --- a/src/data/things/contrib/Contribution.js +++ b/src/data/things/contrib/Contribution.js @@ -314,8 +314,7 @@ export class Contribution extends Thing { } if (artist) { - artistRef = - colors.blue(Thing.getReference(artist)); + artistRef = Thing.inspectReference(artist); } } else { artistRef = @@ -326,7 +325,7 @@ export class Contribution extends Thing { accentParts.push(`by ${artistRef}`); } - if (this.thing) { + if (this.thing) toPart: { if (depth >= 0) { const newOptions = { ...options, @@ -336,10 +335,13 @@ export class Contribution extends Thing { : options.depth - 1), }; - accentParts.push(`to ${inspect(this.thing, newOptions)}`); - } else { - accentParts.push(`to ${colors.blue(Thing.getReference(this.thing))}`); + try { + accentParts.push(`to ${inspect(this.thing, newOptions)}`); + break toPart; + } catch {} } + + accentParts.push(`to ${Thing.inspectReference(this.thing)}`); } if (!empty(accentParts)) { |