Commit 1bf8838a authored by Eliot Berriot's avatar Eliot Berriot 💬

Merge branch '422-musicbrainz-button-no-mbid' into 'develop'

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

Closes #422

See merge request funkwhale/funkwhale!450
parents a30136d2 10fff6ea
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