more search improvements
This commit is contained in:
parent
5508f43aad
commit
a17403b074
2 changed files with 42 additions and 13 deletions
|
@ -764,30 +764,45 @@ const app = new Vue({
|
|||
friendlyTypes(type) {
|
||||
// use switch statement to return friendly name for media types "songs,artists,albums,playlists,music-videos,stations,apple-curators,curators"
|
||||
switch (type) {
|
||||
case "songs":
|
||||
case "song":
|
||||
return "Songs"
|
||||
break;
|
||||
case "artists":
|
||||
case "artist":
|
||||
return "Artists"
|
||||
break;
|
||||
case "albums":
|
||||
case "album":
|
||||
return "Albums"
|
||||
break;
|
||||
case "playlists":
|
||||
case "playlist":
|
||||
return "Playlists"
|
||||
break;
|
||||
case "music-videos":
|
||||
case "music_video":
|
||||
return "Music Videos"
|
||||
break;
|
||||
case "stations":
|
||||
case "station":
|
||||
return "Stations"
|
||||
break;
|
||||
case "apple-curators":
|
||||
case "apple-curator":
|
||||
return "Apple Curators"
|
||||
break;
|
||||
case "curators":
|
||||
case "radio_show":
|
||||
return "Radio Shows"
|
||||
break;
|
||||
case "record_label":
|
||||
return "Record Labels"
|
||||
break;
|
||||
case "radio_episode":
|
||||
return "Episodes"
|
||||
break;
|
||||
case "video_extra":
|
||||
return "Video Extras"
|
||||
break;
|
||||
case "curator":
|
||||
return "Curators"
|
||||
break;
|
||||
case "top":
|
||||
return "Top"
|
||||
break;
|
||||
default:
|
||||
return type
|
||||
break;
|
||||
|
@ -797,7 +812,20 @@ const app = new Vue({
|
|||
let self = this
|
||||
this.mk.api.search(this.search.term,
|
||||
{
|
||||
types: "songs,artists,albums,playlists,music-videos,stations,apple-curators,curators",
|
||||
types: "activities,albums,apple-curators,artists,curators,editorial-items,music-movies,music-videos,playlists,songs,stations,tv-episodes,uploaded-videos,record-labels",
|
||||
"relate[editorial-items]": "contents",
|
||||
"include[editorial-items]": "contents",
|
||||
"include[albums]": "artists",
|
||||
"include[artists]": "artists",
|
||||
"include[songs]": "artists",
|
||||
"include[music-videos]": "artists",
|
||||
"extend": "artistUrl",
|
||||
"fields[artists]": "url,name,artwork,hero",
|
||||
"fields[albums]": "artistName,artistUrl,artwork,contentRating,editorialArtwork,name,playParams,releaseDate,url",
|
||||
"with": "serverBubbles,lyricHighlights",
|
||||
"art[url]": "c,f",
|
||||
"omit[resource]": "autos",
|
||||
"platform": "web",
|
||||
limit: 25
|
||||
}).then(function (results) {
|
||||
self.search.results = results
|
||||
|
|
|
@ -7,24 +7,25 @@
|
|||
<mediaitem-square-large :item="getTopResult()"></mediaitem-square>
|
||||
</template>
|
||||
</div>
|
||||
<div class="col" v-if="search.results.songs">
|
||||
<div class="col" v-if="search.results.song">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>Songs</h3>
|
||||
</div>
|
||||
<div class="col-auto flex-center" v-if="search.results.songs.data.length >= 6">
|
||||
<div class="col-auto flex-center" v-if="search.results.song.data.length >= 6">
|
||||
<button class="cd-btn-seeall">See All</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<mediaitem-list-item :item="item"
|
||||
v-for="item in search.results.songs.data.limit(6)"></mediaitem-list-item>
|
||||
v-for="item in search.results.song.data.limit(6)"></mediaitem-list-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="search.results['meta']">
|
||||
<template v-for="section in search.results.meta.results.order">
|
||||
<template
|
||||
v-for="section in search.results.meta.results.order" v-if="section != 'song'">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>{{ app.friendlyTypes(section) }}</h3>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue