diff --git a/changes/changelog.d/422.bugfix b/changes/changelog.d/422.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..c75b19c7f7775bcde1b5d2c9db054d5765342a4a --- /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 8956d14ccd9cc261ab1e33b3c2a01928d4c802e5..8ea983369df8e87766153229485cf6a62180514e 100644 --- a/front/src/components/library/Album.vue +++ b/front/src/components/library/Album.vue @@ -33,7 +33,7 @@ <i class="wikipedia icon"></i> <translate>Search on Wikipedia</translate> </a> - <a :href="musicbrainzUrl" target="_blank" class="ui button"> + <a v-if="musicbrainzUrl" :href="musicbrainzUrl" target="_blank" class="ui button"> <i class="external icon"></i> <translate>View on MusicBrainz</translate> </a> @@ -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 387596be18bec7ab555dc8daee4da160d2919d0b..7a3c1f7c714cda6eee173225df5ef9774f157214 100644 --- a/front/src/components/library/Artist.vue +++ b/front/src/components/library/Artist.vue @@ -31,7 +31,7 @@ <i class="wikipedia icon"></i> <translate>Search on Wikipedia</translate> </a> - <a :href="musicbrainzUrl" target="_blank" class="ui button"> + <a v-if="musicbrainzUrl" :href="musicbrainzUrl" target="_blank" class="ui button"> <i class="external icon"></i> <translate>View on MusicBrainz</translate> </a> @@ -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 040d3a466f463f829a568815f50d0ebab694e113..483ff66739f582b3facd15237879c9321ae1c841 100644 --- a/front/src/components/library/Track.vue +++ b/front/src/components/library/Track.vue @@ -40,7 +40,7 @@ <i class="wikipedia icon"></i> <translate>Search on Wikipedia</translate> </a> - <a :href="musicbrainzUrl" target="_blank" class="ui button"> + <a v-if="musicbrainzUrl" :href="musicbrainzUrl" target="_blank" class="ui button"> <i class="external icon"></i> <translate>View on MusicBrainz</translate> </a> @@ -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)