add curator page
This commit is contained in:
parent
7cc282f060
commit
bb77f08314
4 changed files with 60 additions and 18 deletions
|
@ -434,29 +434,35 @@ const app = new Vue({
|
|||
},
|
||||
routeView(item) {
|
||||
let self = this
|
||||
app.showingPlaylist = [];
|
||||
|
||||
|
||||
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? ''));
|
||||
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? ''));
|
||||
;
|
||||
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ?? false) : false;
|
||||
console.log(kind, id, isLibrary)
|
||||
|
||||
if (kind.toString().includes("artist")) {
|
||||
app.getArtistInfo(id, isLibrary)
|
||||
} else if (kind.toString().includes("record-label")) {
|
||||
kind = "recordLabel"
|
||||
app.page = (kind) + "_" + (id);
|
||||
console.log("oks");
|
||||
app.getTypeFromID((kind), (id), (isLibrary), {extend: "editorialVideo", views: 'top-releases,latest-releases,top-artists'});
|
||||
}
|
||||
else if (!kind.toString().includes("radioStation") && !kind.toString().includes("song") && !kind.toString().includes("musicVideo") && !kind.toString().includes("uploadedVideo")) {
|
||||
app.page = (kind) + "_" + (id);
|
||||
console.log("oks");
|
||||
app.getTypeFromID((kind), (id), (isLibrary), {extend: "editorialVideo"});
|
||||
} else {
|
||||
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ?? '')
|
||||
// disable apple-curators because they can't be played in MKjs
|
||||
if (!kind.toString().includes("apple-curator")){
|
||||
app.showingPlaylist = [];
|
||||
if (kind.toString().includes("artist")) {
|
||||
app.getArtistInfo(id, isLibrary)
|
||||
} else if (kind.toString().includes("record-label") || kind.toString().includes("curator")) {
|
||||
if (kind.toString().includes("record-label"))
|
||||
{kind = "recordLabel"}
|
||||
else {kind = "curator"}
|
||||
app.page = (kind) + "_" + (id);
|
||||
console.log("oks");
|
||||
app.getTypeFromID((kind), (id), (isLibrary), {extend: "editorialVideo",include: 'grouping,playlists', views: 'top-releases,latest-releases,top-artists'});
|
||||
}
|
||||
else if (!kind.toString().includes("radioStation") && !kind.toString().includes("song") && !kind.toString().includes("musicVideo") && !kind.toString().includes("uploadedVideo")) {
|
||||
app.page = (kind) + "_" + (id);
|
||||
console.log("oks");
|
||||
app.getTypeFromID((kind), (id), (isLibrary), {extend: "editorialVideo"});
|
||||
} else {
|
||||
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ?? '')
|
||||
}
|
||||
document.querySelector("#app-content").scrollTop = 0
|
||||
}
|
||||
document.querySelector("#app-content").scrollTop = 0
|
||||
},
|
||||
async getNowPlayingItemDetailed(target){
|
||||
let u = await app.mkapi(app.mk.nowPlayingItem.playParams.kind, (app.mk.nowPlayingItem.songId == -1) , (app.mk.nowPlayingItem.songId != -1) ? app.mk.nowPlayingItem.songId : app.mk.nowPlayingItem.id, {"include[songs]":"albums,artists"} );
|
||||
|
|
|
@ -263,6 +263,11 @@
|
|||
<cider-recordlabel :data="showingPlaylist"></cider-recordlabel>
|
||||
</template>
|
||||
</transition>
|
||||
<transition name="wpfade">
|
||||
<template v-if="page.includes('curator_')">
|
||||
<cider-recordlabel :data="showingPlaylist"></cider-recordlabel>
|
||||
</template>
|
||||
</transition>
|
||||
<!-- Browse -->
|
||||
<transition name="wpfade">
|
||||
<template v-if="page == 'browse'">
|
||||
|
|
|
@ -85,6 +85,21 @@
|
|||
this.triggerEnabled = false;
|
||||
}
|
||||
break;
|
||||
case "listen_now":
|
||||
case "curator":
|
||||
if (this.data.next && this.triggerEnabled) {
|
||||
this.triggerEnabled = false;
|
||||
app.mk.api.v3.music(this.data.next).then(data => {
|
||||
console.log(data);
|
||||
this.data.next = data.data.next;
|
||||
this.data.data = this.data.data.concat(data.data.data);
|
||||
this.triggerEnabled = true;
|
||||
});
|
||||
}else{
|
||||
console.log("No next page");
|
||||
this.triggerEnabled = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
<div>{{ app.showingPlaylist.attributes.description.standard }}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="data.views && data.views['latest-releases']">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>{{ data.views["latest-releases"].attributes.title ?? ""}}</h3>
|
||||
|
@ -37,6 +38,8 @@
|
|||
</div>
|
||||
<mediaitem-square-large :item="item" v-for="item in data.views['latest-releases'].data">
|
||||
</mediaitem-square-large>
|
||||
</template>
|
||||
<template v-if="data.views && data.views['top-releases']">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>{{ data.views["top-releases"].attributes.title ?? ""}}</h3>
|
||||
|
@ -47,6 +50,19 @@
|
|||
</div>
|
||||
<mediaitem-square-large :item="item" v-for="item in data.views['top-releases'].data">
|
||||
</mediaitem-square-large>
|
||||
</template>
|
||||
<template v-if="data.relationships && data.relationships.playlists && data.relationships.playlists.data.length > 0">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>Playlists</h3>
|
||||
</div>
|
||||
<div class="col-auto flex-center" v-if="data.relationships.playlists.data.length >= 5">
|
||||
<button class="cd-btn-seeall" @click="app.showCollection(data.relationships.playlists, data.attributes.name + ' - Playlists', 'curator')">See All</button>
|
||||
</div>
|
||||
</div>
|
||||
<mediaitem-square-large :item="item" v-for="item in data.relationships.playlists.data.limit(5)">
|
||||
</mediaitem-square-large>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue