2018-08-11 01:47:10 -04:00
|
|
|
<template>
|
2018-12-08 02:48:15 -05:00
|
|
|
<section class="section fd-remove-padding-bottom" v-if="spotify_enabled">
|
2018-08-11 01:47:10 -04:00
|
|
|
<div class="container">
|
|
|
|
<div class="columns is-centered">
|
|
|
|
<div class="column is-four-fifths">
|
|
|
|
<div class="tabs is-centered is-small is-toggle is-toggle-rounded">
|
|
|
|
<ul>
|
2020-11-21 04:57:39 -05:00
|
|
|
<li :class="{ 'is-active': $route.path === '/search/library' }">
|
|
|
|
<a @click="search_library">
|
2018-08-11 01:47:10 -04:00
|
|
|
<span class="icon is-small"><i class="mdi mdi-library-books"></i></span>
|
|
|
|
<span class="">Library</span>
|
|
|
|
</a>
|
2020-11-21 04:57:39 -05:00
|
|
|
</li>
|
|
|
|
<li :class="{ 'is-active': $route.path === '/search/spotify' }">
|
|
|
|
<a @click="search_spotify">
|
2018-08-11 01:47:10 -04:00
|
|
|
<span class="icon is-small"><i class="mdi mdi-spotify"></i></span>
|
|
|
|
<span class="">Spotify</span>
|
|
|
|
</a>
|
2020-11-21 04:57:39 -05:00
|
|
|
</li>
|
2018-08-11 01:47:10 -04:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'TabsSearch',
|
|
|
|
|
2020-11-21 04:57:39 -05:00
|
|
|
props: ['query'],
|
|
|
|
|
2018-08-11 01:47:10 -04:00
|
|
|
computed: {
|
|
|
|
spotify_enabled () {
|
|
|
|
return this.$store.state.spotify.webapi_token_valid
|
2020-11-22 04:17:37 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
route_query: function () {
|
|
|
|
if (!this.query) {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: 'track,artist,album,playlist,audiobook,podcast',
|
|
|
|
query: this.query,
|
|
|
|
limit: 3,
|
|
|
|
offset: 0
|
|
|
|
}
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
2020-11-21 04:57:39 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
search_library: function () {
|
|
|
|
this.$router.push({
|
|
|
|
path: '/search/library',
|
2020-11-22 04:17:37 -05:00
|
|
|
query: this.route_query
|
2020-11-21 04:57:39 -05:00
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
search_spotify: function () {
|
|
|
|
this.$router.push({
|
|
|
|
path: '/search/spotify',
|
2020-11-22 04:17:37 -05:00
|
|
|
query: this.route_query
|
2020-11-21 04:57:39 -05:00
|
|
|
})
|
|
|
|
}
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|