From a8a48d66045cc477aefe8309acda6b3fb4c773a1 Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Thu, 16 Jun 2022 16:40:25 +0100 Subject: [PATCH] filter loop fixes (2) --- src/preload/cider-preload.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/preload/cider-preload.js b/src/preload/cider-preload.js index 57ae5df3..add40edf 100644 --- a/src/preload/cider-preload.js +++ b/src/preload/cider-preload.js @@ -23,14 +23,13 @@ const MusicKitInterop = { MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => { console.debug('[cider:preload] nowPlayingItemDidChange') const attributes = MusicKitInterop.getAttributes() - const trackFilter = MusicKitInterop.filterTrack(attributes, false, true) - if (trackFilter) { + if (MusicKitInterop.filterTrack(attributes, false, true)) { global.ipcRenderer.send('nowPlayingItemDidChange', attributes); + } else if (attributes.name !== 'no-title-found' && attributes.playParams.id !== "no-id-found") { + global.ipcRenderer.send('lastfm:nowPlayingChange', attributes); } - global.ipcRenderer.send('lastfm:nowPlayingChange', attributes); - if (MusicKit.getInstance().nowPlayingItem) { await this.sleep(750); MusicKit.getInstance().playbackRate = app.cfg.audio.playbackRate;