diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js index ef57b9f5..70c64bb1 100644 --- a/resources/cider-ui-tests/index.js +++ b/resources/cider-ui-tests/index.js @@ -68,6 +68,7 @@ const app = new Vue({ desiredDuration: 0, userInteraction: false }, + browsepage: [], listennow: [], radio: { personal: [] @@ -262,7 +263,9 @@ const app = new Vue({ this.mk.addEventListener(MusicKit.Events.nowPlayingItemDidChange, (a) => { this.currentSongInfo = a - a = a.item.attributes; + try{ + a = a.item.attributes; + } catch(_){} let type = (self.mk.nowPlayingItem != null) ? self.mk.nowPlayingItem["type"] ?? '' : ''; @@ -279,6 +282,7 @@ const app = new Vue({ app.getNowPlayingArtworkBG(32); app.loadLyrics() + try{ // Playback Notifications if ((app.platform === "darwin" || app.platform === "linux") && !document.hasFocus()) { if (this.notification) { @@ -290,6 +294,7 @@ const app = new Vue({ silent: true }) } + } catch (_){} }) this.apiCall('https://api.music.apple.com/v1/me/library/playlists', res => { @@ -453,12 +458,10 @@ const app = new Vue({ {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 ?? '') @@ -1003,6 +1006,30 @@ const app = new Vue({ this.getListenNow(attempt + 1) } }, + async getBrowsePage(attempt = 0) { + if (attempt > 3) { + return + } + try { + var browse = await this.mk.api.groupings("", + { + platform: "web", + name: "music", + "omit[resource:artists]": "relationships", + "include[albums]": "artists", + "include[songs]": "artists", + "include[music-videos]": "artists", + extend: "editorialArtwork,artistUrl", + "fields[artists]": "name,url,artwork,editorialArtwork,genreNames,editorialNotes", + "art[url]": "f" + }); + this.browsepage = browse[0]; + console.log(this.browsepage) + } catch (e) { + console.log(e) + this.getBrowsePage(attempt + 1) + } + }, async getRadioStations(attempt = 0) { if (attempt > 3) { return diff --git a/resources/cider-ui-tests/views/components/mediaitem-mvview.ejs b/resources/cider-ui-tests/views/components/mediaitem-mvview.ejs index a1c93021..e25d0cb1 100644 --- a/resources/cider-ui-tests/views/components/mediaitem-mvview.ejs +++ b/resources/cider-ui-tests/views/components/mediaitem-mvview.ejs @@ -7,8 +7,8 @@ + :size="imagesize ?? 300" + >
\ No newline at end of file diff --git a/resources/cider-ui-tests/views/components/mediaitem-scroller-horizontal-mvview.ejs b/resources/cider-ui-tests/views/components/mediaitem-scroller-horizontal-mvview.ejs index 87517da9..e9ce60a7 100644 --- a/resources/cider-ui-tests/views/components/mediaitem-scroller-horizontal-mvview.ejs +++ b/resources/cider-ui-tests/views/components/mediaitem-scroller-horizontal-mvview.ejs @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/resources/cider-ui-tests/views/main.ejs b/resources/cider-ui-tests/views/main.ejs index 4035f501..704ae6ac 100644 --- a/resources/cider-ui-tests/views/main.ejs +++ b/resources/cider-ui-tests/views/main.ejs @@ -269,9 +269,9 @@ - + @@ -407,6 +408,9 @@ + +<%- include('pages/browse') %> + <%- include('pages/listen_now') %> diff --git a/resources/cider-ui-tests/views/pages/browse.ejs b/resources/cider-ui-tests/views/pages/browse.ejs index e69de29b..9899f631 100644 --- a/resources/cider-ui-tests/views/pages/browse.ejs +++ b/resources/cider-ui-tests/views/pages/browse.ejs @@ -0,0 +1,37 @@ + + + \ No newline at end of file