From bb77f083145f5ff4176133b1895086a1e1c5f6a8 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 14 Dec 2021 00:01:48 +0700 Subject: [PATCH] add curator page --- resources/cider-ui-tests/index.js | 40 +++++++++++-------- resources/cider-ui-tests/views/main.ejs | 5 +++ .../views/pages/collection-list.ejs | 15 +++++++ .../views/pages/recordLabel.ejs | 18 ++++++++- 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js index b86d9498..46083e9e 100644 --- a/resources/cider-ui-tests/index.js +++ b/resources/cider-ui-tests/index.js @@ -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"} ); diff --git a/resources/cider-ui-tests/views/main.ejs b/resources/cider-ui-tests/views/main.ejs index 4bce8b00..4035f501 100644 --- a/resources/cider-ui-tests/views/main.ejs +++ b/resources/cider-ui-tests/views/main.ejs @@ -263,6 +263,11 @@ + + +