Use buildMbidUrl helper also for artist credits
3 files changed, 19 insertions(+), 6 deletions(-) A assets/javascripts/discourse/components/listenbrainz-linked-artist.js M assets/javascripts/discourse/templates/components/listenbrainz-artist-credits.hbs A assets/javascripts/discourse/templates/components/listenbrainz-linked-artist.hbs
A assets/javascripts/discourse/components/listenbrainz-linked-artist.js => assets/javascripts/discourse/components/listenbrainz-linked-artist.js +13 -0
@@ 0,0 1,13 @@ import Component from '@glimmer/component' import { buildMbidUrl } from '../lib/listenbrainz-utils' export default class ListenbrainzLinkedArtistComponent extends Component { constructor(owner, args) { super(owner, args) this.credits = args.credits } get artistUrl() { return buildMbidUrl('artist', this.credits?.artist_mbid) } }
M assets/javascripts/discourse/templates/components/listenbrainz-artist-credits.hbs => assets/javascripts/discourse/templates/components/listenbrainz-artist-credits.hbs +1 -6
@@ 1,8 1,3 @@ {{#each @artists as |c|~}} {{#if c.artist_mbid~}} <a href="https://listenbrainz.org/artist/{{c.artist_mbid}}" target="_blank">{{c.artist_credit_name}}</a> {{~else~}} {{c.artist_credit_name}} {{~/if}}{{c.join_phrase}} {{listenbrainz-linked-artist credits=c~}}{{c.join_phrase}} {{~/each}}
A assets/javascripts/discourse/templates/components/listenbrainz-linked-artist.hbs => assets/javascripts/discourse/templates/components/listenbrainz-linked-artist.hbs +5 -0