lastfm annoying
This commit is contained in:
parent
93666366a5
commit
720970b2e2
2 changed files with 10 additions and 17 deletions
|
@ -29,7 +29,9 @@ export default class lastfm {
|
|||
|
||||
onReady(_win: Electron.BrowserWindow): void {
|
||||
this.initializeLastFM("", this._apiCredentials);
|
||||
}
|
||||
|
||||
onRendererReady(): void {
|
||||
// Register the ipcMain handlers
|
||||
this._utils.getIPCMain().handle("lastfm:url", (event: any) => {
|
||||
console.debug(`[${lastfm.name}:url] Called.`);
|
||||
|
@ -52,28 +54,17 @@ export default class lastfm {
|
|||
this.updateNowPlayingTrack(attributes);
|
||||
});
|
||||
|
||||
this._utils.getIPCMain().on("lastfm:FilteredNowPlayingItemDidChange", (event: any, attributes: any) => {
|
||||
if (this._utils.getStoreValue("general.privateEnabled")) return;
|
||||
this.updateNowPlayingTrack(attributes);
|
||||
});
|
||||
|
||||
this._utils.getIPCMain().on("lastfm:scrobbleTrack", (event: any, attributes: any) => {
|
||||
if (this._utils.getStoreValue("general.privateEnabled")) return;
|
||||
this.scrobbleTrack(attributes);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs on playback State Change
|
||||
* @param attributes Music Attributes (attributes.status = current state)
|
||||
*/
|
||||
onPlaybackStateDidChange(attributes: object): void {}
|
||||
|
||||
/**
|
||||
* Runs on song change
|
||||
* @param attributes Music Attributes
|
||||
* @param scrobble
|
||||
*/
|
||||
onNowPlayingItemDidChange(attributes: any, scrobble = false): void {
|
||||
if (this._utils.getStoreValue("general.privateEnabled")) return;
|
||||
this.updateNowPlayingTrack(attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize LastFM
|
||||
* @param token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue