Verified Commit fb855cd0 authored by Ciaran Ainsworth's avatar Ciaran Ainsworth Committed by Eliot Berriot
Browse files

Added buttons to search for objects on Discogs

parent a1d01105
Added button to search for objects on Discogs (#368)
......@@ -61,7 +61,11 @@
<i class="external icon"></i>
<translate translate-context="Content/*/*/Clickable, Verb">View on MusicBrainz</translate>
</a>
<router-link
<a :href="discogsUrl" target="_blank" rel="noreferrer noopener" class="basic item">
<i class="external icon"></i>
<translate translate-context="Content/*/Button.Label/Verb">Search on Discogs</translate>
</a>
<router-link
v-if="object.is_local"
:to="{name: 'library.albums.edit', params: {id: object.id }}"
class="basic item">
......@@ -168,6 +172,13 @@ export default {
return "https://musicbrainz.org/release/" + this.object.mbid
}
},
discogsUrl() {
return (
"https://discogs.com/search/?type=release&title=" +
encodeURI(this.object.title) + "&artist=" +
encodeURI(this.object.artist.name)
)
},
headerStyle() {
if (!this.object.cover.original) {
return ""
......
......@@ -72,6 +72,10 @@
<i class="external icon"></i>
<translate translate-context="Content/*/*/Clickable, Verb">View on MusicBrainz</translate>
</a>
<a :href="discogsUrl" target="_blank" rel="noreferrer noopener" class="basic item">
<i class="external icon"></i>
<translate translate-context="Content/*/Button.Label/Verb">Search on Discogs</translate>
</a>
<router-link
v-if="object.is_local"
:to="{name: 'library.artists.edit', params: {id: object.id }}"
......@@ -205,6 +209,12 @@ export default {
return "https://musicbrainz.org/artist/" + this.object.mbid
}
},
discogsUrl() {
return (
"https://discogs.com/search/?type=artist&title=" +
encodeURI(this.object.name)
)
},
cover() {
return this.object.albums
.filter(album => {
......
......@@ -76,6 +76,10 @@
<i class="external icon"></i>
<translate translate-context="Content/*/*/Clickable, Verb">View on MusicBrainz</translate>
</a>
<a :href="discogsUrl" target="_blank" rel="noreferrer noopener" class="basic item">
<i class="external icon"></i>
<translate translate-context="Content/*/Button.Label/Verb">Search on Discogs</translate>
</a>
<router-link
v-if="track.is_local"
:to="{name: 'library.tracks.edit', params: {id: track.id }}"
......@@ -180,6 +184,14 @@ export default {
return "https://musicbrainz.org/recording/" + this.track.mbid
}
},
discogsUrl() {
return (
"https://discogs.com/search/?type=release&title=" +
encodeURI(this.track.album.title) + "&artist=" +
encodeURI(this.track.artist.name) + "&track=" +
encodeURI(this.track.title)
)
},
downloadUrl() {
let u = this.$store.getters["instance/absoluteUrl"](
this.upload.listen_url
......
Supports Markdown
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