From cd0e8fb0aa2a6ac778ed06fb75c0283578f5729d Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Tue, 8 Mar 2022 17:57:26 -0800 Subject: [PATCH] added "Show in Apple Music" to now playing context menu --- src/i18n/en_US.json | 1 + src/i18n/source/en_US.json | 1 + src/renderer/assets/music.svg | 1 + src/renderer/main/vueapp.js | 14 ++++++++++++++ 4 files changed, 17 insertions(+) create mode 100644 src/renderer/assets/music.svg diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index dd1e0c5e..5d437392 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -207,6 +207,7 @@ "action.goToArtist": "Go to Artist", "action.goToAlbum": "Go to Album", "action.showInPlaylist": "Show in Playlist", + "action.showInAppleMusic": "Show in Apple Music", "action.moveToTop": "Move out of Folder", "action.share": "Share", "action.rename": "Rename", diff --git a/src/i18n/source/en_US.json b/src/i18n/source/en_US.json index dd1e0c5e..5d437392 100644 --- a/src/i18n/source/en_US.json +++ b/src/i18n/source/en_US.json @@ -207,6 +207,7 @@ "action.goToArtist": "Go to Artist", "action.goToAlbum": "Go to Album", "action.showInPlaylist": "Show in Playlist", + "action.showInAppleMusic": "Show in Apple Music", "action.moveToTop": "Move out of Folder", "action.share": "Share", "action.rename": "Rename", diff --git a/src/renderer/assets/music.svg b/src/renderer/assets/music.svg new file mode 100644 index 00000000..7bee2f7e --- /dev/null +++ b/src/renderer/assets/music.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 638aa49b..617b87ba 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -3687,6 +3687,15 @@ const app = new Vue({ app.appRoute(`album/${app.mk.nowPlayingItem.relationships.albums.data[0].id}`) } }, + { + "id": "showInMusic", + "icon": "./assets/music.svg", + "hidden": true, + "name": app.getLz('action.showInAppleMusic'), + "action": function () { + app.routeView(app.mk.nowPlayingItem._container) + } + }, { "icon": "./assets/feather/share.svg", "name": app.getLz('action.share'), @@ -3713,6 +3722,11 @@ const app = new Vue({ menus.normal.items = menus.normal.items.concat(this.contextExt.normal) } } + + if(app.mk.nowPlayingItem._container["attributes"] && app.mk.nowPlayingItem._container.name != "station") { + menus.normal.items.find(x => x.id == "showInMusic").hidden = false + } + this.showMenuPanel(menus[useMenu], event) try {