From 8f0558ab5b434ffc9a869f289c3ba277b53888b6 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Sat, 4 Jun 2022 08:26:43 +0700 Subject: [PATCH] add charts page (groupings) --- src/i18n/en_US.json | 1 + src/main/base/browserwindow.ts | 6 ++ src/main/base/vrouting.json | 5 ++ src/renderer/main/vueapp.js | 5 +- src/renderer/views/pages/charts.ejs | 133 ++++++++++++++++++++++++++++ 5 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 src/renderer/views/pages/charts.ejs diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index fab5fe54..041df7c8 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -42,6 +42,7 @@ "term.artists": "Artists", "term.podcasts": "Podcasts", "term.playlists": "Playlists", + "term.charts": "Charts", "term.playlist": "Playlist", "term.newPlaylist": "New Playlist", "term.newPlaylistFolder": "New Playlist Folder", diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 86ba10da..3e4d8838 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -59,6 +59,7 @@ export class BrowserWindow { "pages/library-recentlyadded", "pages/browse", "pages/groupings", + "pages/charts", "pages/settings", "pages/installed-themes", "pages/listen_now", @@ -201,6 +202,11 @@ export class BrowserWindow { component: ``, condition: `page == 'groupings'`, onEnter: `` + },{ + page: "charts", + component: ``, + condition: `page == 'charts'`, + onEnter: `` }, { page: "listen_now", component: ``, diff --git a/src/main/base/vrouting.json b/src/main/base/vrouting.json index 71a43c7b..6d69582c 100644 --- a/src/main/base/vrouting.json +++ b/src/main/base/vrouting.json @@ -95,6 +95,11 @@ "component": "", "condition": "page == 'groupings'", "onEnter": "" + },{ + "page": "charts", + "component": "", + "condition": "page == 'charts'", + "onEnter": "" }, { "page": "listen_now", diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index eaa8334a..b33357bd 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -500,8 +500,11 @@ const app = new Vue({ }) }, goToGrouping(url = "https://music.apple.com/WebObjects/MZStore.woa/wa/viewGrouping?cc=us&id=34") { + if (url.includes('viewTop')){ + window.location.hash = `#charts/top` + } else { const id = url.split("id=")[1]; - window.location.hash = `#groupings/${id}` + window.location.hash = `#groupings/${id}`} }, navigateForward() { history.forward() diff --git a/src/renderer/views/pages/charts.ejs b/src/renderer/views/pages/charts.ejs new file mode 100644 index 00000000..0df6f93c --- /dev/null +++ b/src/renderer/views/pages/charts.ejs @@ -0,0 +1,133 @@ + + + \ No newline at end of file