NextFire / apple-music-discord-rpc

šŸŽµ Discord Rich Presence Client for the macOS Apple Music app and iTunes
MIT License
511 stars 33 forks source link

Smarter refresh scheduling #84

Closed NextFire closed 4 months ago

NextFire commented 4 months ago

Fix #40 Fix #79

The script will now schedule a refresh 1s after the end of the current track (will not work after a skip).

I had some concerns about exceeding the rate limit of the protocol (https://github.com/NextFire/apple-music-discord-rpc/issues/40#issuecomment-1326990870) but it looks like Discord has updated their documentation since the last time I checked it:

Developers do not need to do anything to handle this rate limit. The SDK will queue up any presence updates sent in that window and send the newest one once the client is free to do so.

We could even poll and refresh the activity every 1s now but I don't think this would be very resource efficient nor really pertinentā€¦