mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 23:55:57 -05:00
[web-src] Fix switching to Spotify search with empty query
This commit is contained in:
parent
b8a66a92cf
commit
b7369afc50
@ -34,39 +34,34 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
spotify_enabled () {
|
spotify_enabled () {
|
||||||
return this.$store.state.spotify.webapi_token_valid
|
return this.$store.state.spotify.webapi_token_valid
|
||||||
|
},
|
||||||
|
|
||||||
|
route_query: function () {
|
||||||
|
if (!this.query) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: 'track,artist,album,playlist,audiobook,podcast',
|
||||||
|
query: this.query,
|
||||||
|
limit: 3,
|
||||||
|
offset: 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
search_library: function () {
|
search_library: function () {
|
||||||
if (!this.query) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/search/library',
|
path: '/search/library',
|
||||||
query: {
|
query: this.route_query
|
||||||
type: 'track,artist,album,playlist,audiobook,podcast',
|
|
||||||
query: this.query,
|
|
||||||
limit: 3,
|
|
||||||
offset: 0
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
search_spotify: function () {
|
search_spotify: function () {
|
||||||
if (!this.query) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/search/spotify',
|
path: '/search/spotify',
|
||||||
query: {
|
query: this.route_query
|
||||||
type: 'track,artist,album,playlist,audiobook,podcast',
|
|
||||||
query: this.query,
|
|
||||||
limit: 3,
|
|
||||||
offset: 0
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user