From 22cd97563504af2c470f0c1956f8b0d11047400c Mon Sep 17 00:00:00 2001 From: vapormusic Date: Sat, 21 May 2022 14:19:34 +0700 Subject: [PATCH] some fixes --- src/renderer/main/vueapp.js | 14 ++++++---- .../views/components/mediaitem-mvview-sp.ejs | 28 +++++++++++-------- .../mediaitem-scroller-horizontal-mvview.ejs | 7 +++-- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index bab8e939..9cace20c 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -1678,10 +1678,10 @@ const app = new Vue({ }) }, routeView(item) { - 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; + 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 ?? '')); + console.log(item); + let isLibrary = item.attributes?.playParams ? (item.attributes?.playParams?.isLibrary ?? false) : false; if (kind.includes("playlist") || kind.includes("album")) { app.showingPlaylist = []; } @@ -1701,8 +1701,10 @@ const app = new Vue({ this.routeView(item.relationships.contents.data[0]) } else if (item.attributes?.link?.url != null) { if (item.attributes.link.url.includes("viewMultiRoom")) { - - id = item.attributes.link.url.substring(item.attributes.link.url.lastIndexOf("=") + 1) + const params = new Proxy(new URLSearchParams(item.attributes.link.url), { + get: (searchParams, prop) => searchParams.get(prop), + }); + id = params.fcId app.getTypeFromID("multiroom", id, false, { platform: "web", extend: "editorialArtwork,uber,lockupStyle" diff --git a/src/renderer/views/components/mediaitem-mvview-sp.ejs b/src/renderer/views/components/mediaitem-mvview-sp.ejs index bc4e3efa..aac89b4b 100644 --- a/src/renderer/views/components/mediaitem-mvview-sp.ejs +++ b/src/renderer/views/components/mediaitem-mvview-sp.ejs @@ -1,30 +1,30 @@ \ No newline at end of file diff --git a/src/renderer/views/components/mediaitem-scroller-horizontal-mvview.ejs b/src/renderer/views/components/mediaitem-scroller-horizontal-mvview.ejs index 1d58039e..0083e3bc 100644 --- a/src/renderer/views/components/mediaitem-scroller-horizontal-mvview.ejs +++ b/src/renderer/views/components/mediaitem-scroller-horizontal-mvview.ejs @@ -2,9 +2,12 @@