set timeout can go away now

This commit is contained in:
Core 2022-07-11 02:02:11 +01:00
parent c410809b68
commit 23b6033432
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
2 changed files with 68 additions and 59 deletions

View file

@ -919,6 +919,12 @@ const app = new Vue({
}
});
this.mk.addEventListener(MusicKit.Events.playbackProgressDidChange, () => {
if (self.mk.currentPlaybackProgress === (app.cfg.connectivity.lastfm.scrobble_after / 100)) {
ipcRenderer.send('lastfm:scrobbleTrack', MusicKitInterop.getAttributes());
}
})
this.mk.addEventListener(MusicKit.Events.playbackStateDidChange, (event) => {
ipcRenderer.send('wsapi-updatePlaybackState', wsapi.getAttributes());
document.body.setAttribute("playback-state", event.state == 2 ? "playing" : "paused")