filter loop fixes (2)

This commit is contained in:
Core 2022-06-16 16:40:25 +01:00
parent 742e606c09
commit a8a48d6604
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -23,14 +23,13 @@ const MusicKitInterop = {
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => { MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
console.debug('[cider:preload] nowPlayingItemDidChange') console.debug('[cider:preload] nowPlayingItemDidChange')
const attributes = MusicKitInterop.getAttributes() const attributes = MusicKitInterop.getAttributes()
const trackFilter = MusicKitInterop.filterTrack(attributes, false, true)
if (trackFilter) { if (MusicKitInterop.filterTrack(attributes, false, true)) {
global.ipcRenderer.send('nowPlayingItemDidChange', attributes); 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) { if (MusicKit.getInstance().nowPlayingItem) {
await this.sleep(750); await this.sleep(750);
MusicKit.getInstance().playbackRate = app.cfg.audio.playbackRate; MusicKit.getInstance().playbackRate = app.cfg.audio.playbackRate;