Verified Commit 10fff6ea authored by Agate's avatar Agate 💬

Fix #422: Do not display "view on MusicBrainz" button if we miss the mbid

parent a8f7893d
Pipeline #2264 passed with stages
in 7 minutes and 50 seconds
Do not display "view on MusicBrainz" button if we miss the mbid (#422)
......@@ -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) {
......
......@@ -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 = []
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment