renderer side of lastfm updated
This commit is contained in:
parent
47e3ad5b44
commit
2827dfb36d
5 changed files with 24 additions and 22 deletions
|
@ -52,6 +52,15 @@ export default class lastfm {
|
|||
// console.debug('lastfm:auth', event, token)
|
||||
this.authenticateLastFM(token)
|
||||
})
|
||||
|
||||
this._utils.getIPCMain().on('lastfm:disconnect', (event: any) => {
|
||||
this._lfm.setSessionCredentials(null, null);
|
||||
this._authenticated = false;
|
||||
this._utils.setStoreValue('lastfm.enabled', false)
|
||||
this._utils.setStoreValue('lastfm.secrets.username', "")
|
||||
this._utils.setStoreValue('lastfm.secrets.key', "")
|
||||
console.debug('[lastfm] [disconnect] Disconnected')
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,10 +119,11 @@ export default class lastfm {
|
|||
console.error(err);
|
||||
return;
|
||||
}
|
||||
this._utils.setStoreValue("lastfm.secrets.token", token)
|
||||
this._utils.setStoreValue('lastfm.secrets.username', session.username);
|
||||
this._utils.setStoreValue('lastfm.secrets.key', session.key);
|
||||
this._utils.setStoreValue('lastfm.enabled', true)
|
||||
this._authenticated = true;
|
||||
console.debug(`[${lastfm.name}] [authenticate] Authenticated as ${session.username}`)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue