multiroom

This commit is contained in:
vapormusic 2022-05-20 22:11:53 +07:00
parent b5e68114eb
commit 90c37ebc98
6 changed files with 104 additions and 4 deletions

View file

@ -64,6 +64,7 @@ export class BrowserWindow {
"pages/cider-playlist", "pages/cider-playlist",
"pages/playlist-inline", "pages/playlist-inline",
"pages/recordLabel", "pages/recordLabel",
"pages/cider-multiroom",
"pages/collection-list", "pages/collection-list",
"pages/apple-curator", "pages/apple-curator",
"pages/artist", "pages/artist",
@ -173,6 +174,10 @@ export class BrowserWindow {
page: "recordLabel_", page: "recordLabel_",
component: `<cider-recordlabel :data="showingPlaylist"></cider-recordlabel>`, component: `<cider-recordlabel :data="showingPlaylist"></cider-recordlabel>`,
condition: `page.includes('recordLabel_')` condition: `page.includes('recordLabel_')`
}, {
page: "multiroom",
component: `<cider-multiroom :data="multiroom"></cider-multiroom>`,
condition: `page.includes('multiroom')`
}, { }, {
page: "curator_", page: "curator_",
component: `<cider-recordlabel :data="showingPlaylist"></cider-recordlabel>`, component: `<cider-recordlabel :data="showingPlaylist"></cider-recordlabel>`,

View file

@ -1637,4 +1637,29 @@
background: transparent; background: transparent;
border : 0px; border : 0px;
} }
}
.content-inner.cider-multiroom{
padding: 0px;
.detail{
padding: 32px;
}
.header-desc{
font-size: 1em;
font-weight: 400;
}
.artworkContainer{
height: 300px;
width : 100%;
img{
height: 100%;
width: 100%;
overflow: hidden;
object-fit: cover;
filter: unset;
&:last-child{
transform: unset;
}
}
}
} }

View file

@ -53,6 +53,7 @@ const app = new Vue({
}, },
showingPlaylist: [], showingPlaylist: [],
appleCurator: [], appleCurator: [],
multiroom: [],
artistPage: { artistPage: {
data: {}, data: {},
}, },
@ -1699,7 +1700,21 @@ const app = new Vue({
if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) { if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) {
this.routeView(item.relationships.contents.data[0]) this.routeView(item.relationships.contents.data[0])
} else if (item.attributes?.link?.url != null) { } else if (item.attributes?.link?.url != null) {
window.open(item.attributes.link.url) if (item.attributes.link.url.includes("viewMultiRoom")) {
id = item.attributes.link.url.substring(item.attributes.link.url.lastIndexOf("=") + 1)
app.getTypeFromID("multiroom", id, false, {
platform: "web",
extend: "editorialArtwork,uber,lockupStyle"
}).then(()=> {
kind = "multiroom"
window.location.hash = `${kind}/${id}`
document.querySelector("#app-content").scrollTop = 0
})
return;
} else {
window.open(item.attributes.link.url)}
} }
} else if (kind.toString().includes("artist")) { } else if (kind.toString().includes("artist")) {
@ -1944,6 +1959,8 @@ const app = new Vue({
} finally { } finally {
if (kind == "appleCurator") { if (kind == "appleCurator") {
app.appleCurator = a.data.data[0] app.appleCurator = a.data.data[0]
} else if (kind == "multiroom"){
app.multiroom = a.data.data[0]
} else { } else {
this.getPlaylistContinuous(a, true) this.getPlaylistContinuous(a, true)
} }
@ -1951,6 +1968,8 @@ const app = new Vue({
} finally { } finally {
if (kind == "appleCurator") { if (kind == "appleCurator") {
app.appleCurator = a.data.data[0] app.appleCurator = a.data.data[0]
} else if (kind == "multiroom"){
app.multiroom = a.data.data[0]
} else { } else {
this.getPlaylistContinuous(a, true) this.getPlaylistContinuous(a, true)
} }
@ -2184,7 +2203,10 @@ const app = new Vue({
} }
let truemethod = (!method.endsWith("s")) ? (method + "s") : method; let truemethod = (!method.endsWith("s")) ? (method + "s") : method;
try { try {
if (library) { if (method.includes(`multiroom`)) {
return await this.mk.api.v3.music(`v1/editorial/${app.mk.storefrontId}/${truemethod}/${term.toString()}`, params, params2)
}
else if (library) {
return await this.mk.api.v3.music(`v1/me/library/${truemethod}/${term.toString()}`, params, params2) return await this.mk.api.v3.music(`v1/me/library/${truemethod}/${term.toString()}`, params, params2)
} else { } else {
return await this.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/${truemethod}/${term.toString()}`, params, params2) return await this.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/${truemethod}/${term.toString()}`, params, params2)

View file

@ -37,6 +37,6 @@
return { return {
app: this.$root app: this.$root
} }
}, }
}) })
</script> </script>

View file

@ -0,0 +1,48 @@
<script type="text/x-template" id="cider-multiroom">
<div class="content-inner cider-multiroom">
<div class="artworkContainer">
<artwork-material :url="data.attributes.uber.masterArt.url" size="800" images="1"></artwork-material>
</div>
<div class="detail">
<h1 class="header-text">{{data.attributes?.title ?? ""}}</h1>
<h2 class="header-desc" v-html='data.relationships?.children?.data[0]?.attributes?.description ?? ""'></h2>
<template v-if="data.relationships">
<template v-for="(recom,index) in data.relationships.children.data">
<div class="row">
<div class="col" v-if="recom.attributes.name != 'Chart Set'">
<h3>{{ recom.attributes?.title ?? ""}}</h3>
</div>
<div class="col-auto flex-center" v-if="index != 0 && recom.relationships && ((recom.relationships.children && recom.relationships.children.data.length > 10) || (recom.relationships.contents && recom.relationships.contents.data.length > 10))">
<button class="cd-btn-seeall" @click="app.showCollection(recom.relationships.children ? recom.relationships.children : recom.relationships.contents, recom.attributes.name ?? '', 'listen_now')" >{{app.getLz('term.seeAll')}}</button>
</div>
</div>
<template v-if="recom.relationships && ((recom.relationships.children && recom.relationships.children.data) || (recom.relationships.contents && recom.relationships.contents.data))">
<template v-if="(recom.attributes.name && recom.attributes.name.includes('ideo')) || index === 0">
<mediaitem-scroller-horizontal-mvview :imagesize="800" :browsesp="index == 0"
:items="recom.relationships.children ? recom.relationships.children.data.limit(10) : recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-mvview>
</template>
<template v-else-if="recom.attributes.name == 'Chart Set'">
</template>
<template v-else>
<mediaitem-scroller-horizontal-large
:items="recom.relationships.children ? recom.relationships.children.data.limit(10) : recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-large>
</template>
</template>
</template>
</template>
</div>
</div>
</script>
<script>
Vue.component('cider-multiroom', {
template: "#cider-multiroom",
props: ["data"],
data: function() {
return {
app: this.$root
}
}
})
</script>

View file

@ -78,7 +78,7 @@
}, },
methods: { methods: {
getArtistPalette(artist) { getArtistPalette(artist) {
if (artist["attributes"]["artwork"]) { if (artist?.attributes?.artwork != null) {
return { return {
"background": "#" + artist["attributes"]["artwork"]["bgColor"], "background": "#" + artist["attributes"]["artwork"]["bgColor"],
"color": "#" + artist["attributes"]["artwork"]["textColor1"], "color": "#" + artist["attributes"]["artwork"]["textColor1"],