enforce Private Sessions on RPC and LastFM
This commit is contained in:
parent
3c5ac8446c
commit
ae9ea1d668
3 changed files with 9 additions and 4 deletions
|
@ -23,6 +23,7 @@
|
||||||
"term.about": "Über",
|
"term.about": "Über",
|
||||||
"term.privateSession": "Private Sitzung",
|
"term.privateSession": "Private Sitzung",
|
||||||
"term.queue": "Warteschlange",
|
"term.queue": "Warteschlange",
|
||||||
|
"term.history": "Verlauf",
|
||||||
"term.search": "Suche",
|
"term.search": "Suche",
|
||||||
"term.library": "Mediathek",
|
"term.library": "Mediathek",
|
||||||
"term.listenNow": "Jetzt Hören",
|
"term.listenNow": "Jetzt Hören",
|
||||||
|
|
|
@ -207,6 +207,7 @@ export default class DiscordRichPresence {
|
||||||
this.connect((DiscordRichPresence._store.general.discord_rpc == 1) ? '911790844204437504' : '886578863147192350');
|
this.connect((DiscordRichPresence._store.general.discord_rpc == 1) ? '911790844204437504' : '886578863147192350');
|
||||||
console.debug(`[Plugin][${this.name}] Ready.`);
|
console.debug(`[Plugin][${this.name}] Ready.`);
|
||||||
ipcMain.on('updateRPCImage', (_event, imageurl) => {
|
ipcMain.on('updateRPCImage', (_event, imageurl) => {
|
||||||
|
if (DiscordRichPresence._store.visual.showuserinfo){
|
||||||
fetch('https://api.cider.sh/v1/images' ,{
|
fetch('https://api.cider.sh/v1/images' ,{
|
||||||
|
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -221,7 +222,7 @@ export default class DiscordRichPresence {
|
||||||
self._attributes["artwork"]["url"] = json.url
|
self._attributes["artwork"]["url"] = json.url
|
||||||
self.updateActivity(self._attributes)
|
self.updateActivity(self._attributes)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,8 +238,9 @@ export default class DiscordRichPresence {
|
||||||
* @param attributes Music Attributes (attributes.status = current state)
|
* @param attributes Music Attributes (attributes.status = current state)
|
||||||
*/
|
*/
|
||||||
onPlaybackStateDidChange(attributes: object): void {
|
onPlaybackStateDidChange(attributes: object): void {
|
||||||
|
if (DiscordRichPresence._store.visual.showuserinfo){
|
||||||
this._attributes = attributes
|
this._attributes = attributes
|
||||||
this.updateActivity(attributes)
|
this.updateActivity(attributes)}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -246,7 +248,8 @@ export default class DiscordRichPresence {
|
||||||
* @param attributes Music Attributes
|
* @param attributes Music Attributes
|
||||||
*/
|
*/
|
||||||
onNowPlayingItemDidChange(attributes: object): void {
|
onNowPlayingItemDidChange(attributes: object): void {
|
||||||
|
if (DiscordRichPresence._store.visual.showuserinfo){
|
||||||
this._attributes = attributes
|
this._attributes = attributes
|
||||||
this.updateActivity(attributes)
|
this.updateActivity(attributes)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,13 +258,14 @@ export default class LastFMPlugin {
|
||||||
* @param attributes Music Attributes
|
* @param attributes Music Attributes
|
||||||
*/
|
*/
|
||||||
nowPlayingItemDidChangeLastFM(attributes: any): void {
|
nowPlayingItemDidChangeLastFM(attributes: any): void {
|
||||||
|
if (this._store.visual.showuserinfo){
|
||||||
attributes.status = true
|
attributes.status = true
|
||||||
if (!this._store.lastfm.filterLoop) {
|
if (!this._store.lastfm.filterLoop) {
|
||||||
this._lastfm.cachedNowPlayingAttributes = false;
|
this._lastfm.cachedNowPlayingAttributes = false;
|
||||||
this._lastfm.cachedAttributes = false
|
this._lastfm.cachedAttributes = false
|
||||||
}
|
}
|
||||||
this.updateNowPlayingSong(attributes)
|
this.updateNowPlayingSong(attributes)
|
||||||
this.scrobbleSong(attributes)
|
this.scrobbleSong(attributes)}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue