diff --git a/src/renderer/less/elements.less b/src/renderer/less/elements.less index 19f960e7..b2c7377a 100644 --- a/src/renderer/less/elements.less +++ b/src/renderer/less/elements.less @@ -334,6 +334,15 @@ width: 42px; height: 42px; flex: 0 0 auto; + &.circle{ + border-radius: 50%; + .mediaitem-artwork{ + border-radius: 50%; + } + img { + border-radius: 50%; + } + } } &:hover { @@ -349,6 +358,11 @@ color: #eee; } + &.hintactive { + background: var(--keyColor); + border-radius: 6px; + } + .queue-info { justify-content: center; display: flex; @@ -392,6 +406,18 @@ } } +.search-hints .cd-queue-item{ + &:hover { + background: var(--selected); + border-radius: 6px; + } + &:active { + background: var(--selected-click); + color: #eee; + border-radius: 6px; + } +} + /* horizontal media scroller */ .cd-hmedia-scroller { &::-webkit-scrollbar-thumb { diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index d9aaed7c..76dffdd3 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -1903,8 +1903,18 @@ const app = new Vue({ this.search.hints = []; return; } - let hints = await (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/search/hints?term=${this.search.term}`)).data.results; - this.search.hints = hints ? hints.terms : []; + let hints = await (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/search/suggestions?term=${this.search.term}`, + {"fields[albums]": "artwork,name,playParams,url,artistName,id", + "fields[artists]": "url,name,artwork,id", + "fields[songs]": "artwork,name,playParams,url,artistName,id", + "kinds": "terms,topResults", + "l": this.mklang, + "limit[results:terms]": 5, + "limit[results:topResults]": 5, + "omit[resource]": "autos", + "platform": "web", + "types": "activities,albums,artists,editorial-items,music-movies,playlists,record-labels,songs,stations"})).data.results; + this.search.hints = hints ? hints.suggestions : []; }, getSongProgress() { if (this.playerLCD.userInteraction) { @@ -3890,15 +3900,22 @@ const app = new Vue({ if (e.keyCode == "40") { if (this.search.hints.length - 1 < this.search.cursor + 1) return; this.search.cursor++; - this.search.term = this.search.hints[this.search.cursor]; + let item = this.search.hints[this.search.cursor] + this.search.term = item.content ? (item.content?.attributes?.name ?? "") :item.displayTerm; } else if (e.keyCode == "38") { if (this.search.cursor == 0) return; this.search.cursor--; - this.search.term = this.search.hints[this.search.cursor]; + let item = this.search.hints[this.search.cursor] + this.search.term = item.content ? (item.content?.attributes?.name ?? "") :item.displayTerm; } }, async searchQuery(term = this.search.term) { let self = this; + if (typeof term === "object"){ + this.routeView(term) + this.search.term = "" + return; + } if (term == "") { return; } diff --git a/src/renderer/views/app/chrome-top.ejs b/src/renderer/views/app/chrome-top.ejs index a65f0a7e..2530ba0c 100644 --- a/src/renderer/views/app/chrome-top.ejs +++ b/src/renderer/views/app/chrome-top.ejs @@ -277,10 +277,10 @@ diff --git a/src/renderer/views/components/sidebar.ejs b/src/renderer/views/components/sidebar.ejs index baf16fe4..1c89bc6a 100644 --- a/src/renderer/views/components/sidebar.ejs +++ b/src/renderer/views/components/sidebar.ejs @@ -7,10 +7,10 @@ + diff --git a/src/renderer/views/pages/search.ejs b/src/renderer/views/pages/search.ejs index 2f8d967a..abd3d053 100644 --- a/src/renderer/views/pages/search.ejs +++ b/src/renderer/views/pages/search.ejs @@ -4,17 +4,48 @@
- +
+