added toggle for song.link button in discord rpc (#1435)
* Add song.link * added toggle for song.link button for discord rpc Co-authored-by: Charles Surett <surettcharles@gmail.com>
This commit is contained in:
parent
57edd48b1f
commit
9cb864b971
4 changed files with 17 additions and 1 deletions
|
@ -530,6 +530,7 @@
|
||||||
"settings.option.connectivity.discordRPC.clientName": "Client Name",
|
"settings.option.connectivity.discordRPC.clientName": "Client Name",
|
||||||
"settings.option.connectivity.discordRPC.clearOnPause": "Clear Discord Rich Presence on Pause",
|
"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.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.hideTimestamp": "Hide timestamp on Discord Rich Presence",
|
||||||
"settings.option.connectivity.discordRPC.detailsFormat": "Details Format",
|
"settings.option.connectivity.discordRPC.detailsFormat": "Details Format",
|
||||||
"settings.option.connectivity.discordRPC.stateFormat": "State Format",
|
"settings.option.connectivity.discordRPC.stateFormat": "State Format",
|
||||||
|
|
|
@ -74,6 +74,7 @@ export class Store {
|
||||||
client: "Cider",
|
client: "Cider",
|
||||||
clear_on_pause: true,
|
clear_on_pause: true,
|
||||||
hide_buttons: false,
|
hide_buttons: false,
|
||||||
|
show_songlink: false,
|
||||||
hide_timestamp: false,
|
hide_timestamp: false,
|
||||||
state_format: "by {artist}",
|
state_format: "by {artist}",
|
||||||
details_format: "{title}",
|
details_format: "{title}",
|
||||||
|
|
|
@ -233,11 +233,13 @@ export default class DiscordRPC {
|
||||||
*/
|
*/
|
||||||
private filterActivity(activity: any, attributes: any): Object {
|
private filterActivity(activity: any, attributes: any): Object {
|
||||||
// Add the buttons if people want them
|
// 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")) {
|
if (!this._utils.getStoreValue("connectivity.discord_rpc.hide_buttons")) {
|
||||||
activity.buttons = [
|
activity.buttons = [
|
||||||
{ label: "Listen on Cider", url: attributes.url.cider },
|
{ label: "Listen on Cider", url: attributes.url.cider },
|
||||||
{ label: "View on Apple Music", url: attributes.url.appleMusic },
|
{ label: "View on Apple Music", url: attributes.url.appleMusic },
|
||||||
]; //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
|
// Add the timestamp if its playing and people want them
|
||||||
|
|
|
@ -960,6 +960,18 @@
|
||||||
</div>
|
</div>
|
||||||
</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-line" v-show="app.cfg.connectivity.discord_rpc.enabled != false">
|
||||||
<div class="md-option-segment">
|
<div class="md-option-segment">
|
||||||
{{$root.getLz('settings.option.connectivity.discordRPC.hideTimestamp')}}
|
{{$root.getLz('settings.option.connectivity.discordRPC.hideTimestamp')}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue