PKBeam / AMWin-RP

A Discord Rich Presence client for Apple Music's native Windows app.
GNU General Public License v3.0
509 stars 27 forks source link

Slight delay in rich presence as well as album art and timestamps #92

Closed wont-stream closed 6 months ago

wont-stream commented 6 months ago

Version Info 1.4.0

Describe the bug When a song changes, Discord takes a second to display the new song. In addition it takes a good second for the album art and timestamps to be sent to Discord.

It also seems to have a delay between the current progress in the song and the progress Discord has.

I don't think I would consider this a bug more of a slight inconvenience.

Have the symptoms of this bug already been reported in another issue? Not that I know of.

Log Files Nothing found in event viewer, and no logs produced.

Edit: Fix version info

wont-stream commented 6 months ago

Just read that last part of the readme. What is the possibility of using the Windows Media Player API to fetch album art, and have it uploaded to a 3rd party service?

PKBeam commented 6 months ago

When a song changes, Discord takes a second to display the new song. In addition it takes a good second for the album art and timestamps to be sent to Discord. This is expected due to networking/API latencies.

The album art and timestamps need to be obtained from the Last.FM API (or scraped from Apple Music web which is much slower), then they need to be sent to Discord. So that’s already two round trip latencies plus whatever client or server processing time occurs in between.

If the entire thing only takes one second then that’s very good.

It also seems to have a delay between the current progress in the song and the progress Discord has.

If this delay is less than a few seconds then that’s normal. The timestamp does not take into account the extra time that will elapse after it gets sent off to the Discord API and before the API processes it.

Finally, Discord also specifies a rate limit of once per 15 seconds for rich presence APIs. This will be enforced by the RPC library, Discord API or both, and will incur wait times at some point. No way around it.

What is the possibility of using the Windows Media Player API to fetch album art, and have it uploaded to a 3rd party service?

Difficult and very time consuming to implement. I don’t plan on touching it but if anyone wants to submit a PR I’m happy to review it.

The latency of this will be the same as before (at least 2 RTT + client/server processing time) plus the extra time needed to upload the image to the hosting service.

wont-stream commented 6 months ago

I see, thanks for the clarification, feel free to close this issue 🙂