diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 50af04eb..9c6d0c24 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -530,6 +530,7 @@ "settings.option.connectivity.discordRPC.clientName": "Client Name", "settings.option.connectivity.discordRPC.clearOnPause": "Clear Discord Rich Presence on Pause", "settings.option.connectivity.discordRPC.hideButtons": "Hide buttons on Discord Rich Presence", + "settings.option.connectivity.discordRPC.showSongLink": "Show Song.link button on Discord Rich Presence", "settings.option.connectivity.discordRPC.hideTimestamp": "Hide timestamp on Discord Rich Presence", "settings.option.connectivity.discordRPC.detailsFormat": "Details Format", "settings.option.connectivity.discordRPC.stateFormat": "State Format", diff --git a/src/main/base/store.ts b/src/main/base/store.ts index e4fe23e3..d8238082 100644 --- a/src/main/base/store.ts +++ b/src/main/base/store.ts @@ -74,6 +74,7 @@ export class Store { client: "Cider", clear_on_pause: true, hide_buttons: false, + show_songlink: false, hide_timestamp: false, state_format: "by {artist}", details_format: "{title}", diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index d16737eb..185bbcd5 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -233,12 +233,13 @@ export default class DiscordRPC { */ private filterActivity(activity: any, attributes: any): Object { // Add the buttons if people want them + const showSongLink = this._utils.getStoreValue("connectivity.discord_rpc.show_songlink"); if (!this._utils.getStoreValue("connectivity.discord_rpc.hide_buttons")) { activity.buttons = [ { label: "Listen on Cider", url: attributes.url.cider }, { label: "View on Apple Music", url: attributes.url.appleMusic }, - { label: "Song.link", url: 'https://song.link/i/' + attributes.songId } - ]; //To change attributes.url => preload/cider-preload.js + ... showSongLink ? [{label: "Song.link", url: 'https://song.link/i/' + attributes.songId}] : [] + ]; //To change attributes.url => preload/cider-preload.js } // Add the timestamp if its playing and people want them diff --git a/src/renderer/views/components/settings-window.ejs b/src/renderer/views/components/settings-window.ejs index 41eb60da..0018a1ae 100644 --- a/src/renderer/views/components/settings-window.ejs +++ b/src/renderer/views/components/settings-window.ejs @@ -960,6 +960,18 @@ +