Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
|
4c012205ee |
14
src/main.cpp
14
src/main.cpp
|
@ -24,20 +24,18 @@ LastFM* lastfm = nullptr;
|
||||||
|
|
||||||
void handleRPCTasks() {
|
void handleRPCTasks() {
|
||||||
while (true) {
|
while (true) {
|
||||||
while (true) {
|
while (!Discord_IsConnected()) {
|
||||||
DiscordEventHandlers discordHandler{};
|
DiscordEventHandlers handlers{};
|
||||||
auto app = utils::getApp(lastMediaSource);
|
auto app = utils::getApp(lastMediaSource);
|
||||||
Discord_Initialize(app.clientId.c_str(), &discordHandler);
|
Discord_Initialize(app.clientId.c_str(), &handlers);
|
||||||
if (Discord_IsConnected())
|
|
||||||
break;
|
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
}
|
}
|
||||||
while (true) {
|
|
||||||
|
while (Discord_IsConnected()) {
|
||||||
Discord_RunCallbacks();
|
Discord_RunCallbacks();
|
||||||
if (!Discord_IsConnected())
|
|
||||||
break;
|
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
Discord_Shutdown();
|
Discord_Shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue