Google-Play-Music-Desktop-Player-UNOFFICIAL- icon indicating copy to clipboard operation
Google-Play-Music-Desktop-Player-UNOFFICIAL- copied to clipboard

Updates and Fixes issues with Discord Rich Presences

Open Alipoodle opened this issue 5 years ago • 3 comments

My system and some pre information

Note I've had to disable the pre-commit as it simply would not run no matter what the debugging I tried on it But info: node -v : v8.15.0 npm -v: v6.4.1 This was Tested on a Win10 64x (1903)

npm run lint has been ran, and no errors returned.

Fixes:

Possible fix to #2969 This issue seemed to be caused by a dead RPC connection when Discord wasn't open, still trying to send requests to it. This is fixed by using a Connected / Disconnected varaible which prevents from sending requests to nothing. This is not verified as I was not experiancing the issue before, but from my testing of a few hours on my PC, (On and Off Discord) My RAM never really exceeded much 300MBs.

Fixes #3266 This is fixed by using my own Discord application instead of the currently used one. I've previously requested to join the existing Application but haven't got a reply. I have this one setup for teams already, and willing to add people if I'm provided with a Discord username + Discrim. (Discord only supports Full Admin at the moment so it will be restricted to main Contributers, People who have got previously approve Discord RPC work)

Fixes #3404 This will currently try to reconnect to the client on a State change but the Event listeners on Google Play Music might get moved around.

Explaination stuff...

Looking through the Basic Discord-rich-presences library used before, there was no event triggered for disconnecting from client. This is why I have instead replace it with the native discord-rpc library instead of the wrapper library originally used, for better control over the RPC + all of the events including the Disconnect.

Added features

I've also added an additional feature of showing a Heart icon on songs which are liked. Heart icon example

Testing

Sadly this can't have a testing Library but I will create YouTube Video including a showing example of it all working!

Crappy YouTube Video showing "stuff"

Edit: Been rolling with this as my Daily driver for my Google Play Music, and a friend of mine has been using the prebuilt version for their daily driver for a few weeks, with no issues towards it showing up incorrectly.

Discussion

One thing that probably needs a bit more questioning would be the usage of the Application's event listeners and for when to check for a connection for Discord.


This change is Reviewable

Alipoodle avatar Jan 26 '20 21:01 Alipoodle

Thank you.

EnchantedLeaves avatar Feb 11 '20 02:02 EnchantedLeaves

can we get these changes merged? i would love to have presence working again

krazyito65 avatar Sep 18 '20 05:09 krazyito65

@MarshallOfSound Can this be merged? It's getting pretty old... 🤔

Sxtanna avatar Dec 15 '20 16:12 Sxtanna