working on adding social people and playlists in search, testing home page in dev mode
This commit is contained in:
parent
df6ba93242
commit
3c17e15b08
8 changed files with 293 additions and 47 deletions
|
@ -114,6 +114,7 @@ const app = new Vue({
|
||||||
hints: [],
|
hints: [],
|
||||||
showHints: false,
|
showHints: false,
|
||||||
results: {},
|
results: {},
|
||||||
|
resultsSocial: {},
|
||||||
limit: 10
|
limit: 10
|
||||||
},
|
},
|
||||||
playerLCD: {
|
playerLCD: {
|
||||||
|
@ -2167,6 +2168,15 @@ const app = new Vue({
|
||||||
}).then(function (results) {
|
}).then(function (results) {
|
||||||
self.search.results = results
|
self.search.results = results
|
||||||
})
|
})
|
||||||
|
await this.mk.api.socialSearch(this.search.term, {
|
||||||
|
types: ["playlists", "social-profiles"],
|
||||||
|
limit: 25,
|
||||||
|
with: ["serverBubbles", "lyricSnippet"],
|
||||||
|
"art[url]": "f",
|
||||||
|
"art[social-profiles:url]": "c"
|
||||||
|
}, { includeResponseMeta: !0 }).then(function (results) {
|
||||||
|
self.search.resultsSocial = results
|
||||||
|
})
|
||||||
},
|
},
|
||||||
isInLibrary(playParams) {
|
isInLibrary(playParams) {
|
||||||
let self = this
|
let self = this
|
||||||
|
|
|
@ -1539,10 +1539,30 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.home-page {
|
||||||
|
background: linear-gradient(0deg, black, #4c2c31);
|
||||||
|
top: 0;
|
||||||
|
padding-top: var(--navbarHeight);
|
||||||
|
|
||||||
|
.user-icon {
|
||||||
|
border-radius: 100%;
|
||||||
|
width: 128px;
|
||||||
|
height: 128px;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: var(--mediaItemShadow-Shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.well.profile-well {
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Cider */
|
/* Cider */
|
||||||
|
|
||||||
.modal-fullscreen {
|
.modal-fullscreen {
|
||||||
display:flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -1552,11 +1572,12 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(0, 0, 0, 0.3);
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
|
||||||
.modal-window {
|
.modal-window {
|
||||||
background: #333;
|
background: #333;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: var(--mediaItemShadow-Shadow);
|
box-shadow: var(--mediaItemShadow-Shadow);
|
||||||
display:flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
max-width: 360px;
|
max-width: 360px;
|
||||||
|
@ -1578,18 +1599,18 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-header {
|
.modal-header {
|
||||||
width:100%;
|
width: 100%;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
width:100%;
|
width: 100%;
|
||||||
height:100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-y: overlay;
|
overflow-y: overlay;
|
||||||
}
|
}
|
||||||
.modal-footer {
|
|
||||||
|
|
||||||
}
|
.modal-footer {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1603,11 +1624,12 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
|
|
||||||
.modal-header {
|
.modal-header {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
position:relative;
|
position: relative;
|
||||||
|
|
||||||
.modal-title {
|
.modal-title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-btn {
|
.close-btn {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -1659,9 +1681,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--selected);
|
background: var(--selected);
|
||||||
|
@ -2180,6 +2200,20 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
image-rendering: -webkit-optimize-contrast;
|
image-rendering: -webkit-optimize-contrast;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.no-shadow {
|
||||||
|
box-shadow: none;
|
||||||
|
&::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.subtle-shadow {
|
||||||
|
box-shadow: var(--mediaItemShadow-ShadowSubtle);
|
||||||
|
}
|
||||||
|
&.shadow {
|
||||||
|
box-shadow: var(--mediaItemShadow-Shadow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2729,8 +2763,8 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
>.menu-btn {
|
>.menu-btn {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
padding:0px;
|
padding: 0px;
|
||||||
border:0px;
|
border: 0px;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
@ -2755,6 +2789,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
||||||
>.play-btn,
|
>.play-btn,
|
||||||
>.menu-btn {
|
>.menu-btn {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@ -2777,6 +2812,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
&.mediaitem-video {
|
&.mediaitem-video {
|
||||||
height: 200px;
|
height: 200px;
|
||||||
width: 240px;
|
width: 240px;
|
||||||
|
|
||||||
.artwork {
|
.artwork {
|
||||||
height: 120px;
|
height: 120px;
|
||||||
width: 212px;
|
width: 212px;
|
||||||
|
@ -2786,16 +2822,27 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
&.mediaitem-brick {
|
&.mediaitem-brick {
|
||||||
height: 200px;
|
height: 200px;
|
||||||
width: 240px;
|
width: 240px;
|
||||||
|
|
||||||
.artwork {
|
.artwork {
|
||||||
height: 123px;
|
height: 123px;
|
||||||
width: 220px;
|
width: 220px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.mediaitem-small {
|
||||||
|
width: 140px;
|
||||||
|
height: 180px;
|
||||||
|
|
||||||
|
.artwork {
|
||||||
|
height: 128px;
|
||||||
|
width: 128px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mediaitem-square */
|
/* mediaitem-square */
|
||||||
.albums-square-containeru > * > .cd-mediaitem-square {
|
.albums-square-containeru>*>.cd-mediaitem-square {
|
||||||
--frame: max(220px, 15vw );
|
--frame: max(220px, 15vw);
|
||||||
width: var(--frame);
|
width: var(--frame);
|
||||||
height: calc(var(--frame) * 13 / 11);
|
height: calc(var(--frame) * 13 / 11);
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
@ -2829,9 +2876,9 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
>.menu-btn {
|
>.menu-btn {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
padding:0px;
|
padding: 0px;
|
||||||
border:0px;
|
border: 0px;
|
||||||
width: calc(var(--frame) / 220 * 30);
|
width: calc(var(--frame) / 220 * 30);
|
||||||
height: calc(var(--frame) / 220 * 30);
|
height: calc(var(--frame) / 220 * 30);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: rgba(50, 50, 50, 0.7);
|
background: rgba(50, 50, 50, 0.7);
|
||||||
|
@ -2843,7 +2890,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
>.play-btn {
|
>.play-btn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: calc(var(--frame) / 220 * 14);
|
bottom: calc(var(--frame) / 220 * 14);
|
||||||
left: calc(var(--frame) / 220 * 14);
|
left: calc(var(--frame) / 220 * 14);
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2855,6 +2902,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
||||||
>.play-btn,
|
>.play-btn,
|
||||||
>.menu-btn {
|
>.menu-btn {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@ -2875,10 +2923,11 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mediaitem-video {
|
&.mediaitem-video {
|
||||||
height:calc(var(--frame) / 220 * 200);
|
height: calc(var(--frame) / 220 * 200);
|
||||||
width: calc(var(--frame) / 220 * 240);
|
width: calc(var(--frame) / 220 * 240);
|
||||||
|
|
||||||
.artwork {
|
.artwork {
|
||||||
height:calc(var(--frame) / 220 * 120);
|
height: calc(var(--frame) / 220 * 120);
|
||||||
width: calc(var(--frame) / 220 * 212);
|
width: calc(var(--frame) / 220 * 212);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2886,9 +2935,10 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
&.mediaitem-brick {
|
&.mediaitem-brick {
|
||||||
height: calc(var(--frame) / 220 * 200);
|
height: calc(var(--frame) / 220 * 200);
|
||||||
width: calc(var(--frame) / 220 * 240);
|
width: calc(var(--frame) / 220 * 240);
|
||||||
|
|
||||||
.artwork {
|
.artwork {
|
||||||
height: calc(var(--frame) / 220 * 123);
|
height: calc(var(--frame) / 220 * 123);
|
||||||
width: calc(var(--frame) );
|
width: calc(var(--frame));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2952,16 +3002,17 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
// Modular
|
// Modular
|
||||||
.modular-fs {
|
.modular-fs {
|
||||||
.app-drawer {
|
.app-drawer {
|
||||||
width:100%;
|
width: 100%;
|
||||||
right:0px;
|
right: 0px;
|
||||||
top:0px;
|
top: 0px;
|
||||||
height:100%;
|
height: 100%;
|
||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
box-shadow: unset;
|
box-shadow: unset;
|
||||||
background: black;
|
background: black;
|
||||||
|
|
||||||
.lyric-body {
|
.lyric-body {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items:center;
|
align-items: center;
|
||||||
|
|
||||||
.lyric-line {
|
.lyric-line {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
@ -2982,6 +3033,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modular
|
// Modular
|
||||||
|
|
||||||
/* Transitions */
|
/* Transitions */
|
||||||
|
@ -3280,7 +3332,7 @@ body.no-gpu {
|
||||||
background: rgb(0 0 0);
|
background: rgb(0 0 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.addtoplaylist-panel {
|
.addtoplaylist-panel {
|
||||||
.modal-window {
|
.modal-window {
|
||||||
background: rgb(18 18 18);
|
background: rgb(18 18 18);
|
||||||
backdrop-filter: unset;
|
backdrop-filter: unset;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script type="text/x-template" id="mediaitem-artwork">
|
<script type="text/x-template" id="mediaitem-artwork">
|
||||||
<div class="mediaitem-artwork" :class="{'rounded': (type == 'artists')}" :key="url" :style="getStyle()"
|
<div class="mediaitem-artwork" :class="[{'rounded': (type == 'artists')}, classes]"
|
||||||
v-observe-visibility="{callback: visibilityChanged}">
|
v-observe-visibility="{callback: visibilityChanged}">
|
||||||
<img :src="app.getMediaItemArtwork(url, size, width)"
|
<img :src="app.getMediaItemArtwork(url, size, width)"
|
||||||
decoding="async" loading="lazy"
|
decoding="async" loading="lazy"
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
},
|
},
|
||||||
shadow: {
|
shadow: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'none'
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
|
@ -49,9 +49,13 @@
|
||||||
isVisible: false,
|
isVisible: false,
|
||||||
style: {
|
style: {
|
||||||
"box-shadow": ""
|
"box-shadow": ""
|
||||||
}
|
},
|
||||||
|
classes: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getClasses()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getVideoPriority() {
|
getVideoPriority() {
|
||||||
if(app.cfg.visual.animated_artwork == "always") {
|
if(app.cfg.visual.animated_artwork == "always") {
|
||||||
|
@ -63,18 +67,21 @@
|
||||||
}
|
}
|
||||||
return this.videoPriority
|
return this.videoPriority
|
||||||
},
|
},
|
||||||
getStyle() {
|
getClasses() {
|
||||||
switch (this.shadow) {
|
switch (this.shadow) {
|
||||||
|
case "none":
|
||||||
|
this.classes.push("no-shadow")
|
||||||
|
break;
|
||||||
case "large":
|
case "large":
|
||||||
this.style["box-shadow"] = "var(--mediaItemShadow-Shadow)"
|
this.classes.push("shadow")
|
||||||
break;
|
break;
|
||||||
case "subtle":
|
case "subtle":
|
||||||
this.style["box-shadow"] = "var(--mediaItemShadow-ShadowSubtle)"
|
this.classes.push("subtle-shadow")
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return this.style;
|
return this.classes;
|
||||||
},
|
},
|
||||||
getArtworkStyle() {
|
getArtworkStyle() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -107,6 +107,9 @@
|
||||||
case "385": // editorial
|
case "385": // editorial
|
||||||
return ["mediaitem-brick"]
|
return ["mediaitem-brick"]
|
||||||
break;
|
break;
|
||||||
|
case "small":
|
||||||
|
return ["mediaitem-small"]
|
||||||
|
break;
|
||||||
case "music-videos":
|
case "music-videos":
|
||||||
case "uploadedVideo":
|
case "uploadedVideo":
|
||||||
case "uploaded-videos":
|
case "uploaded-videos":
|
||||||
|
|
|
@ -168,6 +168,7 @@
|
||||||
<div class="app-sidebar-header-text">
|
<div class="app-sidebar-header-text">
|
||||||
Apple Music
|
Apple Music
|
||||||
</div>
|
</div>
|
||||||
|
<sidebar-library-item v-if="isDev" name="Home" page="home"></sidebar-library-item>
|
||||||
<sidebar-library-item name="Listen Now" page="listen_now"></sidebar-library-item>
|
<sidebar-library-item name="Listen Now" page="listen_now"></sidebar-library-item>
|
||||||
<sidebar-library-item name="Browse" page="browse"></sidebar-library-item>
|
<sidebar-library-item name="Browse" page="browse"></sidebar-library-item>
|
||||||
<sidebar-library-item name="Radio" page="radio"></sidebar-library-item>
|
<sidebar-library-item name="Radio" page="radio"></sidebar-library-item>
|
||||||
|
@ -295,6 +296,12 @@
|
||||||
:title="collectionList.title"></cider-collection-list>
|
:title="collectionList.title"></cider-collection-list>
|
||||||
</template>
|
</template>
|
||||||
</transition>
|
</transition>
|
||||||
|
<!-- Home -->
|
||||||
|
<transition name="wpfade">
|
||||||
|
<template v-if="page == 'home'">
|
||||||
|
<cider-home></cider-home>
|
||||||
|
</template>
|
||||||
|
</transition>
|
||||||
<!-- Playlist / Album page-->
|
<!-- Playlist / Album page-->
|
||||||
<transition name="wpfade">
|
<transition name="wpfade">
|
||||||
<template v-if="page.includes('playlist_')">
|
<template v-if="page.includes('playlist_')">
|
||||||
|
@ -502,6 +509,9 @@
|
||||||
<!-- Listen Now -->
|
<!-- Listen Now -->
|
||||||
<%- include('pages/listen_now') %>
|
<%- include('pages/listen_now') %>
|
||||||
|
|
||||||
|
<!-- Home -->
|
||||||
|
<%- include('pages/home') %>
|
||||||
|
|
||||||
<!-- Playlists / Albums -->
|
<!-- Playlists / Albums -->
|
||||||
<%- include('pages/cider-playlist') %>
|
<%- include('pages/cider-playlist') %>
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,8 @@
|
||||||
triggerEnabled: true,
|
triggerEnabled: true,
|
||||||
canSeeTrigger: false,
|
canSeeTrigger: false,
|
||||||
showFab: false,
|
showFab: false,
|
||||||
commonKind: "song"
|
commonKind: "song",
|
||||||
|
api: this.$root.mk.api
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -72,12 +73,18 @@
|
||||||
case "artists":
|
case "artists":
|
||||||
if (this.data.next && this.triggerEnabled) {
|
if (this.data.next && this.triggerEnabled) {
|
||||||
this.triggerEnabled = false;
|
this.triggerEnabled = false;
|
||||||
this.data.next().then(data => {
|
|
||||||
|
let nextFn = (data => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.data.next = data.next;
|
this.data.next = data.next;
|
||||||
this.data.data = this.data.data.concat(data.data);
|
this.data.data = this.data.data.concat(data.data);
|
||||||
this.triggerEnabled = true;
|
this.triggerEnabled = true;
|
||||||
});
|
});
|
||||||
|
if(typeof this.data.next == "function") {
|
||||||
|
this.data.next().then(data => next);
|
||||||
|
}else{
|
||||||
|
this.api.v3.music(this.data.next).then(data => nextFn);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
console.log("No next page");
|
console.log("No next page");
|
||||||
this.triggerEnabled = false;
|
this.triggerEnabled = false;
|
||||||
|
|
124
src/renderer/views/pages/home.ejs
Normal file
124
src/renderer/views/pages/home.ejs
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
<script type="text/x-template" id="cider-home">
|
||||||
|
<div class="content-inner home-page">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Home</h3>
|
||||||
|
<div class="well profile-well">
|
||||||
|
<div class="user-icon">
|
||||||
|
<mediaitem-artwork shadow="none" :url="profile.attributes.artwork.url" size="300"></mediaitem-artwork>
|
||||||
|
</div>
|
||||||
|
<h3>{{ profile.attributes.name }}</h3>
|
||||||
|
<h4>@{{ profile.attributes.handle }}</h4>
|
||||||
|
<button class="md-btn">Share</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<h3>Recently Played</h3>
|
||||||
|
<div class="well">
|
||||||
|
<mediaitem-list-item v-for="item in recentlyPlayed.limit(6)" :item="item"></mediaitem-list-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Made For You</h3>
|
||||||
|
<div class="well">
|
||||||
|
<mediaitem-square kind="small" v-for="item in madeForYou" :item="item"></mediaitem-square>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<h3>Your Artist Feed</h3>
|
||||||
|
<div class="well">
|
||||||
|
<mediaitem-list-item v-for="item in recentlyPlayed.limit(6)" :item="item"></mediaitem-list-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Friends Listening To</h3>
|
||||||
|
<div class="well">
|
||||||
|
<mediaitem-square kind="small" v-for="item in friendsListeningTo" :item="item"></mediaitem-square>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
Vue.component('cider-home', {
|
||||||
|
template: '#cider-home',
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
app: this.$root,
|
||||||
|
madeForYou: [],
|
||||||
|
recentlyPlayed: [],
|
||||||
|
friendsListeningTo: [],
|
||||||
|
profile: {},
|
||||||
|
modify: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
let self = this
|
||||||
|
this.getListenNowData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getRecentlyPlayed() {
|
||||||
|
|
||||||
|
},
|
||||||
|
async getListenNowData() {
|
||||||
|
let self = this
|
||||||
|
this.app.mk.api.personalRecommendations("",
|
||||||
|
{
|
||||||
|
name: "listen-now",
|
||||||
|
with: "friendsMix,library,social",
|
||||||
|
"art[social-profiles:url]": "c",
|
||||||
|
"art[url]": "c,f",
|
||||||
|
"omit[resource]": "autos",
|
||||||
|
"relate[editorial-items]": "contents",
|
||||||
|
extend: ["editorialCard", "editorialVideo"],
|
||||||
|
"extend[albums]": ["artistUrl"],
|
||||||
|
"extend[library-albums]": ["artistUrl", "editorialVideo"],
|
||||||
|
"extend[playlists]": ["artistNames", "editorialArtwork", "editorialVideo"],
|
||||||
|
"extend[library-playlists]": ["artistNames", "editorialArtwork", "editorialVideo"],
|
||||||
|
"extend[social-profiles]": "topGenreNames",
|
||||||
|
"include[albums]": "artists",
|
||||||
|
"include[songs]": "artists",
|
||||||
|
"include[music-videos]": "artists",
|
||||||
|
"fields[albums]": ["artistName", "artistUrl", "artwork", "contentRating", "editorialArtwork", "editorialVideo", "name", "playParams", "releaseDate", "url"],
|
||||||
|
"fields[artists]": ["name", "url"],
|
||||||
|
"extend[stations]": ["airDate", "supportsAirTimeUpdates"],
|
||||||
|
"meta[stations]": "inflectionPoints",
|
||||||
|
types: "artists,albums,editorial-items,library-albums,library-playlists,music-movies,music-videos,playlists,stations,uploaded-audios,uploaded-videos,activities,apple-curators,curators,tv-shows,social-profiles,social-upsells",
|
||||||
|
platform: "web"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
includeResponseMeta: !0,
|
||||||
|
reload: !0
|
||||||
|
}
|
||||||
|
).then((data) => {
|
||||||
|
console.log(data.data[1])
|
||||||
|
self.recentlyPlayed = data.data[1].relationships.contents.data
|
||||||
|
self.friendsListeningTo = data.data.filter(section => {
|
||||||
|
if (section.meta.metrics.moduleType == "11") {
|
||||||
|
return section
|
||||||
|
}
|
||||||
|
;
|
||||||
|
})[0].relationships.contents.data
|
||||||
|
self.madeForYou = data.data.filter(section => {
|
||||||
|
if (section.meta.metrics.moduleType == "6") {
|
||||||
|
return section
|
||||||
|
}
|
||||||
|
;
|
||||||
|
})[0].relationships.contents.data
|
||||||
|
});
|
||||||
|
|
||||||
|
app.mk.api.v3.music("/v1/me/social/profile/").then((response) => {
|
||||||
|
self.profile = response.data.data[0]
|
||||||
|
console.log("!!!")
|
||||||
|
console.log(response.data.data[0])
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -12,37 +12,70 @@
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<h3>Songs</h3>
|
<h3>Songs</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto flex-center" @click="app.showSearchView(app.search.term, 'song', app.friendlyTypes('song'))" v-if="search.results.song.data.length >= 6">
|
<div class="col-auto flex-center"
|
||||||
|
@click="app.showSearchView(app.search.term, 'song', app.friendlyTypes('song'))"
|
||||||
|
v-if="search.results.song.data.length >= 6">
|
||||||
<button class="cd-btn-seeall">See All</button>
|
<button class="cd-btn-seeall">See All</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<mediaitem-list-item :item="item" :index="index"
|
<mediaitem-list-item :item="item" :index="index"
|
||||||
v-for="(item, index) in search.results.song.data.limit(6)"></mediaitem-list-item>
|
v-for="(item, index) in search.results.song.data.limit(6)"></mediaitem-list-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-if="search.results['meta']">
|
<template v-if="search.results['meta']">
|
||||||
<template
|
<template
|
||||||
v-for="section in search.results.meta.results.order" v-if="section != 'song' && section != 'top'">
|
v-for="section in search.results.meta.results.order" v-if="section != 'song' && section != 'top'">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<h3>{{ app.friendlyTypes(section) }}</h3>
|
<h3>{{ app.friendlyTypes(section) }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto flex-center" v-if="search.results[section].data.length >= 10">
|
<div class="col-auto flex-center" v-if="search.results[section].data.length >= 10">
|
||||||
<button class="cd-btn-seeall" @click="app.showSearchView(app.search.term, section, app.friendlyTypes(section))">See All</button>
|
<button class="cd-btn-seeall"
|
||||||
|
@click="app.showSearchView(app.search.term, section, app.friendlyTypes(section))">See
|
||||||
|
All
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="!app.friendlyTypes(section).includes('Video')">
|
<template v-if="!app.friendlyTypes(section).includes('Video')">
|
||||||
<mediaitem-scroller-horizontal-large
|
<mediaitem-scroller-horizontal-large
|
||||||
:items="search.results[section].data.limit(10)"></mediaitem-scroller-horizontal-large>
|
:items="search.results[section].data.limit(10)"></mediaitem-scroller-horizontal-large>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<mediaitem-scroller-horizontal-mvview
|
<mediaitem-scroller-horizontal-mvview
|
||||||
:items="search.results[section].data.limit(10)"></mediaitem-scroller-horizontal-mvview>
|
:items="search.results[section].data.limit(10)"></mediaitem-scroller-horizontal-mvview>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
</template>
|
||||||
|
<template v-if="search.resultsSocial.playlist">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Shared Playlists</h3>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto flex-center" v-if="search.resultsSocial.playlist.data.data.length >= 10">
|
||||||
|
<button class="cd-btn-seeall"
|
||||||
|
@click="app.showCollection(search.resultsSocial.playlist.data, 'Shared Playlists', 'default')">See All
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<mediaitem-scroller-horizontal-large
|
||||||
|
:items="search.resultsSocial.playlist.data.data.limit(10)"></mediaitem-scroller-horizontal-large>
|
||||||
|
</template>
|
||||||
|
<template v-if="search.resultsSocial.profile">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>People</h3>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto flex-center" v-if="search.resultsSocial.profile.data.data.length >= 10">
|
||||||
|
<button class="cd-btn-seeall"
|
||||||
|
@click="app.showCollection(search.resultsSocial.profile.data, 'People', 'default')">See All
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<mediaitem-scroller-horizontal-large
|
||||||
|
:items="search.resultsSocial.profile.data.data.limit(10)"></mediaitem-scroller-horizontal-large>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
@ -51,7 +84,7 @@
|
||||||
Vue.component('cider-search', {
|
Vue.component('cider-search', {
|
||||||
template: "#cider-search",
|
template: "#cider-search",
|
||||||
props: ['search'],
|
props: ['search'],
|
||||||
data: function() {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
app: this.$root
|
app: this.$root
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue