Merge pull request #448 from autumn-puffin/master

Add option to disable the discord rpc idle text
This commit is contained in:
2024-08-05 18:28:53 +02:00
committed by GitHub
5 changed files with 25 additions and 0 deletions

View File

@@ -14,6 +14,10 @@ export let rpc: Client;
const observer = () => {
if (rpc) {
const showIdle = settingsStore.get<string, boolean>(settings.discord.showIdle) ?? true;
if (mediaInfo.status === MediaStatus.paused && !showIdle) {
rpc.clearActivity();
} else
rpc.setActivity(getActivity());
}
};
@@ -95,6 +99,10 @@ export const initRPC = () => {
rpc.login({ clientId }).then(
() => {
rpc.on("ready", () => {
const showIdle = settingsStore.get<string, boolean>(settings.discord.showIdle) ?? true;
if (mediaInfo.status === MediaStatus.paused && !showIdle) {
rpc.clearActivity();
} else
rpc.setActivity(getActivity());
});
ipcMain.on(globalEvents.updateInfo, observer);

View File

@@ -43,6 +43,7 @@ export const settingsStore = new Store({
enableDiscord: false,
discord: {
showSong: true,
showIdle: true,
idleText: "Browsing Tidal",
usingText: "Playing media on TIDAL",
includeTimestamps: true,