diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js index 9647d122..6e6c9289 100644 --- a/resources/cider-ui-tests/index.js +++ b/resources/cider-ui-tests/index.js @@ -292,6 +292,10 @@ const app = new Vue({ let response = await this.mk.api.artistView(artist, view, {}, {view: view, includeResponseMeta: !0}) await this.showCollection(response, title, "artists") }, + async showRecordLabelView (label, title, view) { + let response = await this.mk.api.recordLabelView(label, view, {}, {view: view, includeResponseMeta: !0}) + await this.showCollection(response, title, "record-labels") + }, async showSearchView(term, group, title) { let response = await this.mk.api.search(term, { platform: "web", @@ -422,9 +426,16 @@ const app = new Vue({ ; 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("radioStation") && !kind.toString().includes("song") && !kind.toString().includes("musicVideo") && !kind.toString().includes("uploadedVideo")) { + } 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"}); @@ -486,12 +497,37 @@ const app = new Vue({ } catch (e) {console.log(e)} } - console.log(albumId); if (albumId != "") { app.getTypeFromID("album",albumId, false); app.page = "album_" + albumId;} - break; + break; + case "recordLabel": + let labelId = ''; + try { + labelId = item.relationships['record-labels'].data[0].id + } + catch (_) { } + + if (labelId == "") { + try { + let labelQuery = await app.mk.api.search(item.attributes.recordLabel, { limit: 1, types: 'record-labels' }) + if (labelQuery["record-labels"].data.length > 0) { + labelId = labelQuery["record-labels"].data[0].id; + console.log(labelId) + } + } + catch (e) {console.log(e)} + } + if (labelId != "") + { + app.showingPlaylist = [] + + await app.getTypeFromID("recordLabel",labelId, false,{views: 'top-releases,latest-releases,top-artists'}); + app.page = "recordLabel_" + labelId; + } + + break; } }, pushNavigationEvent(item) { @@ -528,15 +564,14 @@ const app = new Vue({ }, async getTypeFromID(kind, id, isLibrary = false, params = {}) { var a; - if ("kind" == "album" | "kind" == "albums") { - params["include"] = "tracks,artists,record-labels" + if (kind == "album" | kind == "albums") { + params["include"] = "tracks,artists,record-labels"; } try { a = await this.mkapi(kind.toString(), isLibrary, id.toString(), params); } catch (e) { console.log(e); try { - console.log("opp", !isLibrary); a = await this.mkapi(kind.toString(), !isLibrary, id.toString(), params); } catch (err) { console.log(err); diff --git a/resources/cider-ui-tests/views/main.ejs b/resources/cider-ui-tests/views/main.ejs index af044c86..2561fb16 100644 --- a/resources/cider-ui-tests/views/main.ejs +++ b/resources/cider-ui-tests/views/main.ejs @@ -258,6 +258,10 @@ + + @@ -428,6 +432,9 @@ <%- include('pages/cider-playlist') %> + +<%- include('pages/recordLabel') %> + <%- include('pages/collection-list') %> diff --git a/resources/cider-ui-tests/views/pages/cider-playlist.ejs b/resources/cider-ui-tests/views/pages/cider-playlist.ejs index bd56ead7..1f2fc93e 100644 --- a/resources/cider-ui-tests/views/pages/cider-playlist.ejs +++ b/resources/cider-ui-tests/views/pages/cider-playlist.ejs @@ -58,6 +58,12 @@ +
+ {{data.attributes.releaseDate}} +
+
+ {{data.attributes.copyright}} +
{{app.getTotalTime()}}
diff --git a/resources/cider-ui-tests/views/pages/recordLabel.ejs b/resources/cider-ui-tests/views/pages/recordLabel.ejs new file mode 100644 index 00000000..e736d9d1 --- /dev/null +++ b/resources/cider-ui-tests/views/pages/recordLabel.ejs @@ -0,0 +1,74 @@ + + \ No newline at end of file