-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting UpdatePresenceWhenStopped
is ignored and Presence shows impossible times
#81
Comments
Ok, I did some digging and As it turns out, when The Method that runs in the thread started by But even if that's the case, DiscordBee shouldn't try to send anything unless a connection to discord is established. So I guess the main goal should be to find out how the connection state can be retreived or at least deduced. |
Thanks for your effort. Without having looked into it much I could think of using the Ready Event to check for initialization, provided the event is fired when the actual connection is established. |
That was my thought as well, but I couldn't find out where it's called. |
The Ready Event works. It is called, once the connection is established. But to get notified when the connection is lost, I had to add a callback for the OnConnectionFailed Event. OnClose doesn't get dispatched ofc... I pushed my changes to my fork here. Since initialising a previously deinitialised instance of For the sake of completeness the exception details:
This may be a bug in DiscordRPC or maybe I have screwed up. I don't know yet. But ignoring this exception appears to have no negative effect. I haven't tested if this issue would be solved with my changes, however. |
I found the cause for the exception and it's indeed a bug in DiscordRPC (see this issue). But I forgot to make the crucial change of actually not sending the presence updates while not connected to Discord. This is fixed as of the latest commit to the branch I also tested whether the bug is still happening and it does seem to be fixed. |
Nice work, would you like to open a pull request for it? Also you might want to rebase because I pushed some changes today (which also include a cherry-pick from your master). |
Pull Request is up.
Already done. 🙂 |
Describe the bug
Under certain conditions the Rich Presence is displayed in Discord even though
UpdatePresenceWhenStopped
is turned off and nothing is currently played back. The presence shows information about the last track that was played.To Reproduce
I'm not entirely certain about which conditions can cause this bug to appear. Here is one way to reproduce it (that is, how this bug happened to me today):
UpdatePresenceWhenStopped
should be disabled)Expected behavior
Nothing shown in Discord except my "About Me" text and other stuff that is usually shown when clicking on my name in the userlist.
Screenshots
(In case you didn't know, that song is far shorter than 3h. 😉 )
Environment (please complete the following information):
Additional context
I think the key is to start Discord after MusicBee, while playback is halted but something had been played previously in the same MusicBee session (so that
UpdateDiscordPresence
had been called withPlayState.Playing
at least once).It may be worth to look into what
DiscordRpcClient
does on initialisation when no Discord client is currently running and then later, when Discord is run.The text was updated successfully, but these errors were encountered: