Skip to content
Snippets Groups Projects
Verified Commit 10fff6ea authored by Eliot Berriot's avatar Eliot Berriot
Browse files

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

parent a8f7893d
No related branches found
No related tags found
No related merge requests found
Do not display "view on MusicBrainz" button if we miss the mbid (#422)
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<i class="wikipedia icon"></i> <i class="wikipedia icon"></i>
<translate>Search on Wikipedia</translate> <translate>Search on Wikipedia</translate>
</a> </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> <i class="external icon"></i>
<translate>View on MusicBrainz</translate> <translate>View on MusicBrainz</translate>
</a> </a>
...@@ -105,7 +105,9 @@ export default { ...@@ -105,7 +105,9 @@ export default {
return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.album.title + ' ' + this.album.artist.name) return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.album.title + ' ' + this.album.artist.name)
}, },
musicbrainzUrl () { musicbrainzUrl () {
return 'https://musicbrainz.org/release/' + this.album.mbid if (this.album.mbid) {
return 'https://musicbrainz.org/release/' + this.album.mbid
}
}, },
headerStyle () { headerStyle () {
if (!this.album.cover.original) { if (!this.album.cover.original) {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<i class="wikipedia icon"></i> <i class="wikipedia icon"></i>
<translate>Search on Wikipedia</translate> <translate>Search on Wikipedia</translate>
</a> </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> <i class="external icon"></i>
<translate>View on MusicBrainz</translate> <translate>View on MusicBrainz</translate>
</a> </a>
...@@ -154,7 +154,9 @@ export default { ...@@ -154,7 +154,9 @@ export default {
return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.artist.name) return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.artist.name)
}, },
musicbrainzUrl () { musicbrainzUrl () {
return 'https://musicbrainz.org/artist/' + this.artist.mbid if (this.artist.mbid) {
return 'https://musicbrainz.org/artist/' + this.artist.mbid
}
}, },
allTracks () { allTracks () {
let tracks = [] let tracks = []
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<i class="wikipedia icon"></i> <i class="wikipedia icon"></i>
<translate>Search on Wikipedia</translate> <translate>Search on Wikipedia</translate>
</a> </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> <i class="external icon"></i>
<translate>View on MusicBrainz</translate> <translate>View on MusicBrainz</translate>
</a> </a>
...@@ -199,7 +199,9 @@ export default { ...@@ -199,7 +199,9 @@ export default {
return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.track.title + ' ' + this.track.artist.name) return 'https://en.wikipedia.org/w/index.php?search=' + encodeURI(this.track.title + ' ' + this.track.artist.name)
}, },
musicbrainzUrl () { musicbrainzUrl () {
return 'https://musicbrainz.org/recording/' + this.track.mbid if (this.track.mbid) {
return 'https://musicbrainz.org/recording/' + this.track.mbid
}
}, },
downloadUrl () { downloadUrl () {
let u = this.$store.getters['instance/absoluteUrl'](this.track.listen_url) let u = this.$store.getters['instance/absoluteUrl'](this.track.listen_url)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment