NextFire / apple-music-discord-rpc

🎵 Discord Rich Presence Client for the macOS Apple Music app and iTunes
MIT License
559 stars 37 forks source link

Speed Up Detection? #93

Open wbreiler opened 3 months ago

wbreiler commented 3 months ago

This is more of a question than a suggestion or anything.

Is there any way to speed up the detection of when a song is skipped, paused, or resumed? I've noticed it's anywhere from 3 seconds all the way up to 10 seconds sometimes.

NextFire commented 1 month ago

The default polling rate is set to 1 poll every 15s, you can change it in the script but it might overload the system if you poll too frequently. https://github.com/NextFire/apple-music-discord-rpc/blob/9c247ae804df5af2165b7334e5b062e60384a725/music-rpc.ts#L60

FYI I've also already done some work to quickly schedule a refresh after the end of a song: https://github.com/NextFire/apple-music-discord-rpc/pull/84

However, keep in mind that the Discord client is (still?) rate limiting the presence updates to one every ~15s (it was still in the documentation before last week https://github.com/discord/discord-api-docs/pull/7069/files#diff-dd54ce9ba281235b7838ea96379353f090a4aa94298a61129934541e08dc1b58L83)