added toggle for song.link button for discord rpc
This commit is contained in:
parent
6f51759b40
commit
a56ff9f5c8
4 changed files with 17 additions and 2 deletions
|
@ -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",
|
||||
|
|
|
@ -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}",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -960,6 +960,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md-option-line" v-show="app.cfg.connectivity.discord_rpc.enabled != false">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.connectivity.discordRPC.showSongLink')}}
|
||||
</div>
|
||||
<div class="md-option-segment md-option-segment_auto">
|
||||
<label>
|
||||
<input type="checkbox"
|
||||
v-model="app.cfg.connectivity.discord_rpc.show_songlink" switch/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md-option-line" v-show="app.cfg.connectivity.discord_rpc.enabled != false">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.connectivity.discordRPC.hideTimestamp')}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue