From be1d62afe1b5b4f3712e1fb1b28bc559dbe2d6bf Mon Sep 17 00:00:00 2001 From: 54ac Date: Thu, 12 Sep 2024 01:31:40 +0200 Subject: [PATCH] LastFMRichPresence: Add option to hide presence when any other activity is detected --- src/plugins/lastfm/index.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/lastfm/index.tsx b/src/plugins/lastfm/index.tsx index 02fd694f8..23a0edce2 100644 --- a/src/plugins/lastfm/index.tsx +++ b/src/plugins/lastfm/index.tsx @@ -124,6 +124,11 @@ const settings = definePluginSettings({ type: OptionType.BOOLEAN, default: true, }, + hideWithActivity: { + description: "Hide Last.fm presence if any other activity is detected", + type: OptionType.BOOLEAN, + default: false, + }, statusName: { description: "custom status text", type: OptionType.STRING, @@ -274,7 +279,13 @@ export default definePlugin({ }, async getActivity(): Promise { - if (settings.store.hideWithSpotify) { + if (settings.store.hideWithActivity) { + for (const activity of presenceStore.getActivities()) { + if (activity.application_id !== applicationId) { + return null; + } + } + } else if (settings.store.hideWithSpotify) { for (const activity of presenceStore.getActivities()) { if (activity.type === ActivityType.LISTENING && activity.application_id !== applicationId) { // there is already music status because of Spotify or richerCider (probably more)