[web-src] search page can allow serach by smartpl

This commit is contained in:
whatdoineed2do/Ray 2020-04-07 18:39:00 +01:00 committed by chme
parent 7481365dc2
commit b14d55c922

View File

@ -15,6 +15,12 @@
</p> </p>
</div> </div>
</form> </form>
<div>
<label class="checkbox is-size-7">
<input type="checkbox" v-model="smart_query" :checked=true>
SMART query
</label>
</div>
<div class="tags" style="margin-top: 16px;"> <div class="tags" style="margin-top: 16px;">
<a class="tag" v-for="recent_search in recent_searches" :key="recent_search" @click="open_recent_search(recent_search)">{{ recent_search }}</a> <a class="tag" v-for="recent_search in recent_searches" :key="recent_search" @click="open_recent_search(recent_search)">{{ recent_search }}</a>
</div> </div>
@ -148,6 +154,7 @@ export default {
data () { data () {
return { return {
search_query: '', search_query: '',
smart_query: false,
tracks: { items: [], total: 0 }, tracks: { items: [], total: 0 },
artists: { items: [], total: 0 }, artists: { items: [], total: 0 },
albums: { items: [], total: 0 }, albums: { items: [], total: 0 },
@ -211,7 +218,8 @@ export default {
var searchParams = { var searchParams = {
'type': route.query.type, 'type': route.query.type,
'query': route.query.query, 'query': this.smart_query ? undefined : route.query.query,
'expression': this.smart_query ? route.query.query : undefined,
'media_kind': 'music' 'media_kind': 'music'
} }
@ -226,7 +234,7 @@ export default {
this.albums = data.albums ? data.albums : { items: [], total: 0 } this.albums = data.albums ? data.albums : { items: [], total: 0 }
this.playlists = data.playlists ? data.playlists : { items: [], total: 0 } this.playlists = data.playlists ? data.playlists : { items: [], total: 0 }
this.$store.commit(types.ADD_RECENT_SEARCH, searchParams.query) this.$store.commit(types.ADD_RECENT_SEARCH, route.query.query)
}) })
}, },