add rooms support
This commit is contained in:
parent
3e0ecc294d
commit
20f1470fba
3 changed files with 46 additions and 11 deletions
|
@ -575,7 +575,22 @@ const app = new Vue({
|
|||
window.location.hash = `#charts/top`;
|
||||
} else {
|
||||
const id = url.split("id=")[1];
|
||||
window.location.hash = `#groupings/${id}`;
|
||||
if (id != null){
|
||||
window.location.hash = `#groupings/${id}`;} else {
|
||||
const params = new Proxy(new URLSearchParams(new URL(url).search), {
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
});
|
||||
let id = params.fcId;
|
||||
app.getTypeFromID("room", id, false, {
|
||||
platform: "web",
|
||||
extend: "editorialArtwork,uber,lockupStyle",
|
||||
})
|
||||
.then(() => {
|
||||
let kind = "multiroom";
|
||||
window.location.hash = `${kind}/${id}`;
|
||||
document.querySelector("#app-content").scrollTop = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
navigateForward() {
|
||||
|
@ -2036,13 +2051,18 @@ const app = new Vue({
|
|||
if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) {
|
||||
this.routeView(item.relationships.contents.data[0]);
|
||||
} else if (item.attributes?.link?.url != null) {
|
||||
if (item.attributes.link.url.includes("viewMultiRoom")) {
|
||||
if (item.attributes.link.url.includes("viewMultiRoom") || item.attributes.link.url.includes("/collection/")) {
|
||||
const params = new Proxy(new URLSearchParams(new URL(item.attributes.link.url).search), {
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
});
|
||||
id = params.fcId;
|
||||
app
|
||||
.getTypeFromID("multiroom", id, false, {
|
||||
kind = "multiroom"
|
||||
if (item.attributes.link.url.includes("viewMultiRoom")){
|
||||
kind = "multiroom"
|
||||
} else {
|
||||
kind = "room"
|
||||
}
|
||||
app.getTypeFromID(kind, id, false, {
|
||||
platform: "web",
|
||||
extend: "editorialArtwork,uber,lockupStyle",
|
||||
})
|
||||
|
@ -2362,7 +2382,7 @@ const app = new Vue({
|
|||
} finally {
|
||||
if (kind == "appleCurator") {
|
||||
app.appleCurator = a.data.data[0];
|
||||
} else if (kind == "multiroom") {
|
||||
} else if (kind == "multiroom" || kind == "room") {
|
||||
app.multiroom = a.data.data[0];
|
||||
} else {
|
||||
this.getPlaylistContinuous(a, true);
|
||||
|
@ -2371,7 +2391,7 @@ const app = new Vue({
|
|||
} finally {
|
||||
if (kind == "appleCurator") {
|
||||
app.appleCurator = a.data.data[0];
|
||||
} else if (kind == "multiroom") {
|
||||
} else if (kind == "multiroom" || kind == "room") {
|
||||
app.multiroom = a.data.data[0];
|
||||
} else {
|
||||
this.getPlaylistContinuous(a, true);
|
||||
|
@ -2604,7 +2624,7 @@ const app = new Vue({
|
|||
}
|
||||
let truemethod = !method.endsWith("s") ? method + "s" : method;
|
||||
try {
|
||||
if (method.includes(`multiroom`)) {
|
||||
if (method.includes(`room`)) {
|
||||
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);
|
||||
|
|
|
@ -8,7 +8,22 @@
|
|||
<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">
|
||||
<template v-if="data.type=='rooms' && (data?.relationships?.contents?.data ?? []).length > 0">
|
||||
<div class="row">
|
||||
<div class="col-auto cider-flex-center"
|
||||
v-if="index != 0 && data?.relationships?.contents?.data.length > 10">
|
||||
<button class="cd-btn-seeall"
|
||||
@click="app.showCollection(recom, data.attributes.name ?? '', 'listen_now')">
|
||||
{{app.getLz('term.seeAll')}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<template>
|
||||
<mediaitem-scroller-horizontal-large
|
||||
:items="data?.relationships?.contents?.data.limit(10)"></mediaitem-scroller-horizontal-large>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else v-for="(recom,index) in (data.relationships?.children?.data ?? recom?.relationships?.contents?.data)">
|
||||
<template v-if="(recom.relationships?.contents?.data ?? []).length > 0">
|
||||
<div class="row">
|
||||
<div class="col" v-if="recom.attributes.name != 'Chart Set'">
|
||||
|
@ -37,7 +52,7 @@
|
|||
:items="recom.relationships.children ? recom.relationships.children.data.limit(10) : recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-large>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
|
|
|
@ -86,9 +86,9 @@
|
|||
},
|
||||
mounted() {
|
||||
this.$root.getRadioPage();
|
||||
debugger
|
||||
// debugger
|
||||
this.getRecentlyPlayed();
|
||||
debugger
|
||||
// debugger
|
||||
},
|
||||
methods: {
|
||||
getRecentlyPlayed: async function (next = null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue