From e140784f8f0cdaaa3f23e9437ceb08e529384d15 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 15 Feb 2025 12:32:52 -0500 Subject: [PATCH] LastFM EnableGameActivity --- src/plugins/lastfm/index.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/lastfm/index.tsx b/src/plugins/lastfm/index.tsx index 77fa2784..e4e9c209 100644 --- a/src/plugins/lastfm/index.tsx +++ b/src/plugins/lastfm/index.tsx @@ -17,6 +17,7 @@ */ import { definePluginSettings } from "@api/Settings"; +import { getUserSettingLazy } from "@api/UserSettings"; import { Link } from "@components/Link"; import { Devs } from "@utils/constants"; import { Logger } from "@utils/Logger"; @@ -81,6 +82,8 @@ const enum NameFormat { AlbumName = "album" } +const ShowCurrentGame = getUserSettingLazy("status", "showCurrentGame")!; + const applicationId = "1108588077900898414"; const placeholderId = "2a96cbd8b46e442fc41c2b86b821562f"; @@ -129,6 +132,11 @@ const settings = definePluginSettings({ type: OptionType.BOOLEAN, default: false, }, + enableGameActivity: { + description: "Enable game activity for last.fm", + type: OptionType.BOOLEAN, + default: false, + }, statusName: { description: "custom status text", type: OptionType.STRING, @@ -293,6 +301,11 @@ export default definePlugin({ } const trackData = await this.fetchTrackData(); + if (settings.store.enableGameActivity && trackData) { + ShowCurrentGame.updateSetting(true); + } else if (settings.store.enableGameActivity) { + ShowCurrentGame.updateSetting(false); + } if (!trackData) return null; const largeImage = this.getLargeImage(trackData);