From 10fff6ea673012e047972b4023fe25432b5cca13 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Sat, 20 Oct 2018 16:20:29 +0200 Subject: [PATCH] Fix #422: Do not display "view on MusicBrainz" button if we miss the mbid --- changes/changelog.d/422.bugfix | 1 + front/src/components/library/Album.vue | 6 ++++-- front/src/components/library/Artist.vue | 6 ++++-- front/src/components/library/Track.vue | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 changes/changelog.d/422.bugfix diff --git a/changes/changelog.d/422.bugfix b/changes/changelog.d/422.bugfix new file mode 100644 index 000000000..c75b19c7f --- /dev/null +++ b/changes/changelog.d/422.bugfix @@ -0,0 +1 @@ +Do not display "view on MusicBrainz" button if we miss the mbid (#422) diff --git a/front/src/components/library/Album.vue b/front/src/components/library/Album.vue index 8956d14cc..8ea983369 100644 --- a/front/src/components/library/Album.vue +++ b/front/src/components/library/Album.vue @@ -33,7 +33,7 @@ Search on Wikipedia - + View on MusicBrainz @@ -105,7 +105,9 @@ export default { return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.album.title + ' ' + this.album.artist.name) }, musicbrainzUrl () { - return 'https://musicbrainz.org/release/' + this.album.mbid + if (this.album.mbid) { + return 'https://musicbrainz.org/release/' + this.album.mbid + } }, headerStyle () { if (!this.album.cover.original) { diff --git a/front/src/components/library/Artist.vue b/front/src/components/library/Artist.vue index 387596be1..7a3c1f7c7 100644 --- a/front/src/components/library/Artist.vue +++ b/front/src/components/library/Artist.vue @@ -31,7 +31,7 @@ Search on Wikipedia - + View on MusicBrainz @@ -154,7 +154,9 @@ export default { return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.artist.name) }, musicbrainzUrl () { - return 'https://musicbrainz.org/artist/' + this.artist.mbid + if (this.artist.mbid) { + return 'https://musicbrainz.org/artist/' + this.artist.mbid + } }, allTracks () { let tracks = [] diff --git a/front/src/components/library/Track.vue b/front/src/components/library/Track.vue index 040d3a466..483ff6673 100644 --- a/front/src/components/library/Track.vue +++ b/front/src/components/library/Track.vue @@ -40,7 +40,7 @@ Search on Wikipedia - + View on MusicBrainz @@ -199,7 +199,9 @@ export default { return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.track.title + ' ' + this.track.artist.name) }, musicbrainzUrl () { - return 'https://musicbrainz.org/recording/' + this.track.mbid + if (this.track.mbid) { + return 'https://musicbrainz.org/recording/' + this.track.mbid + } }, downloadUrl () { let u = this.$store.getters['instance/absoluteUrl'](this.track.listen_url)