diff --git a/web-src/src/pages/PageSearch.vue b/web-src/src/pages/PageSearch.vue index 9bf8b62c..58fd9755 100644 --- a/web-src/src/pages/PageSearch.vue +++ b/web-src/src/pages/PageSearch.vue @@ -13,14 +13,11 @@

+

Tip: you can search by a smart playlist query language expression if you prefix it + with query:. +

-
- -
{{ recent_search }}
@@ -154,7 +151,7 @@ export default { data () { return { search_query: '', - smart_query: false, + tracks: { items: [], total: 0 }, artists: { items: [], total: 0 }, albums: { items: [], total: 0 }, @@ -218,11 +215,15 @@ export default { var searchParams = { type: route.query.type, - query: this.smart_query ? undefined : route.query.query, - expression: this.smart_query ? route.query.query : undefined, media_kind: 'music' } + if (route.query.query.startsWith('query:')) { + searchParams.expression = route.query.query.replace(/^query:/, '').trim() + } else { + searchParams.query = route.query.query + } + if (route.query.limit) { searchParams.limit = route.query.limit searchParams.offset = route.query.offset diff --git a/web-src/src/pages/SpotifyPageSearch.vue b/web-src/src/pages/SpotifyPageSearch.vue index fe8d9478..51932246 100644 --- a/web-src/src/pages/SpotifyPageSearch.vue +++ b/web-src/src/pages/SpotifyPageSearch.vue @@ -178,7 +178,7 @@ export default { computed: { recent_searches () { - return this.$store.state.recent_searches + return this.$store.state.recent_searches.filter(search => !search.startsWith('query:')) }, show_tracks () { @@ -222,7 +222,7 @@ export default { this.reset() // If no search query present reset and focus search field - if (!this.query.query || this.query.query === '') { + if (!this.query.query || this.query.query === '' || this.query.query.startsWith('query:')) { this.search_query = '' this.$refs.search_field.focus() return