diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index c8d797b0..d5f0f44b 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -241,7 +241,7 @@ export default class DiscordRPC { } // Add the timestamp if its playing and people want them - if (!this._utils.getStoreValue("connectivity.discord_rpc.hide_timestamp") && attributes.status) { + if (!this._utils.getStoreValue("connectivity.discord_rpc.hide_timestamp") && attributes.status && new Date(attributes.endTime).getTime() > 0 && isFinite(attributes.endTime) && isFinite(attributes.startTime)) { activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime); activity.endTimestamp = attributes.endTime; } @@ -298,12 +298,6 @@ export default class DiscordRPC { activity.largeImageKey = "cider"; } - // Timestamp - if (new Date(attributes.endTime).getTime() < 0) { - delete activity.startTime; - delete activity.endTime; - } - // not sure if (!attributes.artistName) { delete activity.state; diff --git a/src/main/plugins/lastfm.ts b/src/main/plugins/lastfm.ts index ce8a98bf..ba912370 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")) return; + if (this._utils.getStoreValue("connectivity.lastfm.filter_loop") || this._utils.getStoreValue("general.privateEnabled") || attributes.type === "radioStation") return; this.updateNowPlayingTrack(attributes); }); this._utils.getIPCMain().on("lastfm:FilteredNowPlayingItemDidChange", (event: any, attributes: any) => { - if (this._utils.getStoreValue("general.privateEnabled")) return; + if (this._utils.getStoreValue("general.privateEnabled") || attributes.type === "radioStation") return; this.updateNowPlayingTrack(attributes); }); this._utils.getIPCMain().on("lastfm:scrobbleTrack", (event: any, attributes: any) => { - if (this._utils.getStoreValue("general.privateEnabled")) return; + if (this._utils.getStoreValue("general.privateEnabled") || attributes.type === "radioStation") return; this.scrobbleTrack(attributes); }); } diff --git a/src/preload/cider-preload.js b/src/preload/cider-preload.js index e8c62551..da5cd080 100644 --- a/src/preload/cider-preload.js +++ b/src/preload/cider-preload.js @@ -135,6 +135,7 @@ const MusicKitInterop = { const attributes = nowPlayingItem != null ? nowPlayingItem.attributes : {}; attributes.songId = attributes.songId ?? attributes.playParams?.catalogId ?? attributes.playParams?.id; + attributes.type = nowPlayingItem.type ?? ""; attributes.status = isPlayingExport ?? null; attributes.name = attributes?.name ?? "no-title-found"; attributes.artwork = attributes?.artwork ?? { url: "" }; diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 74e92984..2f59ff5d 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -1957,6 +1957,7 @@ const app = new Vue({ * @memberOf app */ convertTime(seconds, format = "short") { + if (app.mk?.nowPlayingItem?.type === "radioStation") return; if (isNaN(seconds) || seconds === Infinity) { seconds = 0; }