From 50a8524f55619a6884cefccb3fe21d59b5a8f1bc Mon Sep 17 00:00:00 2001 From: Core Date: Thu, 22 Sep 2022 15:46:49 +0100 Subject: [PATCH] Fix --- src/main/plugins/lastfm.ts | 10 +++++----- src/preload/cider-preload.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/plugins/lastfm.ts b/src/main/plugins/lastfm.ts index bfceeea3..2c3f2613 100644 --- a/src/main/plugins/lastfm.ts +++ b/src/main/plugins/lastfm.ts @@ -50,17 +50,17 @@ export default class lastfm { }); this._utils.getIPCMain().on("lastfm:nowPlayingChange", (event: any, attributes: any) => { - if (this._utils.getStoreValue("connectivity.lastfm.filter_loop") || this._utils.getStoreValue("general.privateEnabled") || attributes.type === "radioStation") return; + if (this._utils.getStoreValue("connectivity.lastfm.filter_loop") || this._utils.getStoreValue("general.privateEnabled") || attributes.kind === "radioStation") return; this.updateNowPlayingTrack(attributes); }); this._utils.getIPCMain().on("lastfm:FilteredNowPlayingItemDidChange", (event: any, attributes: any) => { - if (this._utils.getStoreValue("general.privateEnabled") || attributes.type === "radioStation") return; + if (this._utils.getStoreValue("general.privateEnabled") || attributes.kind === "radioStation") return; this.updateNowPlayingTrack(attributes); }); this._utils.getIPCMain().on("lastfm:scrobbleTrack", (event: any, attributes: any) => { - if (this._utils.getStoreValue("general.privateEnabled") || attributes.type === "radioStation") return; + if (this._utils.getStoreValue("general.privateEnabled") || attributes.kind === "radioStation") return; this.scrobbleTrack(attributes); }); } @@ -170,7 +170,7 @@ export default class lastfm { return; } - if (!this._authenticated || !attributes || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.playParams.kind] || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.type] || (this._utils.getStoreValue("connectivity.lastfm.filter_loop") && this._scrobbleCache.track === attributes.lfmTrack.name)) return; + if (!this._authenticated || !attributes || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.playParams.kind] || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.kind] || (this._utils.getStoreValue("connectivity.lastfm.filter_loop") && this._scrobbleCache.track === attributes.lfmTrack.name)) return; // Scrobble const scrobble = { @@ -210,7 +210,7 @@ export default class lastfm { return; } - if (!this._authenticated || !attributes || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.playParams.kind] || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.type] || (this._utils.getStoreValue("connectivity.lastfm.filter_loop") && this._nowPlayingCache.track === attributes.lfmTrack.name)) return; + if (!this._authenticated || !attributes || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.playParams.kind] || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.kind] || (this._utils.getStoreValue("connectivity.lastfm.filter_loop") && this._nowPlayingCache.track === attributes.lfmTrack.name)) return; console.log(this._utils.getStoreValue("connectivity.lastfm.filter_types")); diff --git a/src/preload/cider-preload.js b/src/preload/cider-preload.js index cf8c1b4f..afc3cf74 100644 --- a/src/preload/cider-preload.js +++ b/src/preload/cider-preload.js @@ -144,7 +144,7 @@ const MusicKitInterop = { const attributes = nowPlayingItem != null ? nowPlayingItem.attributes : {}; attributes.songId = attributes.songId ?? attributes.playParams?.catalogId ?? attributes.playParams?.id; - attributes.type = nowPlayingItem?.type ?? ""; + attributes.kind = nowPlayingItem?.type ?? attributes.type ?? attributes.playParams.kind ?? ""; attributes.status = nowPlayingItem == null ? null : !!isPlayingExport; attributes.name = attributes?.name ?? "no-title-found"; attributes.artwork = attributes?.artwork ?? { url: "" };