From 25f53f9b72e6c0c3bb5de7ae461d5aaf55853e6b Mon Sep 17 00:00:00 2001 From: vapormusic Date: Sun, 23 Jan 2022 23:14:37 +0700 Subject: [PATCH] disable marquee --- src/main/plugins/discordrpc.ts | 4 ++++ src/renderer/index.js | 7 ++++++- src/renderer/views/main.ejs | 5 +++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index 599560df..77ce5482 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -1,3 +1,4 @@ +import * as electron from 'electron'; import * as DiscordRPC from 'discord-rpc' export default class DiscordRPCPlugin { /** @@ -177,6 +178,9 @@ export default class DiscordRPCPlugin { onReady(win: any): void { this._win = win; this.connect((this._win.store.store.general.discord_rpc == 1) ? '911790844204437504' : '886578863147192350'); + // electron.ipcMain.on("forceUpdateRPC", (event, attributes : object) => { + // this.updateActivity(attributes) + // }); } /** diff --git a/src/renderer/index.js b/src/renderer/index.js index ccadaed6..88961357 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -2877,7 +2877,12 @@ const app = new Vue({ let data = await this.mk.api.v3.music(`/v1/me/library/songs/${this.mk.nowPlayingItem.id}`); data = data.data.data[0]; if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) { - this.currentArtUrl = (data["attributes"]["artwork"]["url"] ?? '').replace('{w}', 50).replace('{h}', 50); + this.currentArtUrl = (data["attributes"]["artwork"]["url"] ?? '').replace('{w}', 50).replace('{h}', 50); + // if (this.currentArtUrl != ""){ + // let attr = MusicKitInterop.getAttributes(); + // attr.artwork.url = this.currentArtUrl; + // ipcRenderer.send('forceUpdateRPC',attr) + // } try { document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`); } catch (e) {} diff --git a/src/renderer/views/main.ejs b/src/renderer/views/main.ejs index 18ff55e4..972027a6 100644 --- a/src/renderer/views/main.ejs +++ b/src/renderer/views/main.ejs @@ -86,16 +86,17 @@
+
{{ mk.nowPlayingItem["attributes"]["name"] }}
+