Compare commits

...

1 Commits
v1.3.3 ... main

Author SHA1 Message Date
EinTim23 4c012205ee refactor rich presence thread 2025-07-20 18:01:47 +02:00
1 changed files with 6 additions and 8 deletions

View File

@ -24,20 +24,18 @@ LastFM* lastfm = nullptr;
void handleRPCTasks() {
while (true) {
while (true) {
DiscordEventHandlers discordHandler{};
while (!Discord_IsConnected()) {
DiscordEventHandlers handlers{};
auto app = utils::getApp(lastMediaSource);
Discord_Initialize(app.clientId.c_str(), &discordHandler);
if (Discord_IsConnected())
break;
Discord_Initialize(app.clientId.c_str(), &handlers);
std::this_thread::sleep_for(std::chrono::seconds(1));
}
while (true) {
while (Discord_IsConnected()) {
Discord_RunCallbacks();
if (!Discord_IsConnected())
break;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
Discord_Shutdown();
}
}