feat: discord rpc changes/improvements #958
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a prototype/design mockup of migrating the current RPC implementation from a 15 second (default) interval to an event based system. For more examples of any part of this PR, check out my fork's implementation which has a bit more in it, including support for changing application name from Feishin to match the artist name instead.
The checks for song id changes, current time changes, and playing state changes are specifically to prevent sending a bunch of useless updates to the RPC server, which will not only act towards the ratelimit but might also push incorrect data as well.
A feature I wasn't able to get quite figured out is idle mode, which to me is useless in the first place but since it exists in development I figured I would try to get it working; unfortunately, I still haven't managed to do that.
I'm also not too sure about the types I'm using, but considering my IDE isn't yelling at me, I'm going to assume it's good enough?