ungive / discord-music-presence

Rich presence for sharing your music listening activity in your Discord status. Works with any media player on your system. For Windows and Mac (and soon Linux).
https://musicpresence.app
Other
40 stars 0 forks source link

Customisable delay before passing information to rich presence #14

Closed poetryofcode closed 1 month ago

poetryofcode commented 1 month ago

Is there an existing issue for this?

Describe the problem

Currently Music Presence passes song information very swiftly so if you skip a lot of tracks it can pass the information when it is not needed.

Solution

It would be helpful to have a customisable delay before Music Presence passes changed song information to rich presence.

Alternatives

Other solution for detecting track skipping and preventing unneeded/-wanted passage could be an option too.

Additional context

No response

ungive commented 1 month ago

Currently Music Presence passes song information very swiftly so if you skip a lot of tracks it can pass the information when it is not needed.

I agree, this could be problematic when you're skipping too often because (1) too many requests are made to Music APIs whose result is discarded again and (2) "[Discord clients] may only update their game status 5 times per 20 seconds" (https://discord.com/developers/docs/topics/gateway-events#activity-object-example-activity-with-rich-presence). The latter is actually a TODO that I didn't get back to yet.

How often (how many songs in a row) and how fast (how much of the song do you listen to) do you skip, that you think this might become a problem? Personally, I rarely skip more than a few songs at a time. What's the context in which you skip a lot? When you discover new songs? Or when you listen to familiar ones? In the latter case I can see how one would skip within the first few seconds since you recognize the song quickly and you know if you want to hear it or not.

poetryofcode commented 1 month ago

What's the context in which you skip a lot? When you discover new songs? Or when you listen to familiar ones?

I mostly stick to either albums I know or playlists I have made.

Especially with older, bigger playlists I may make half a dozen or even a dozen skips before I find a song I'm satisfied with.

I tend to not look for songs from the playlists, just play it and skip it until I find something I like.

In the latter case I can see how one would skip within the first few seconds since you recognize the song quickly and you know if you want to hear it or not.

I tend to have TIDAL etc. on my second screen, so I can see the name and skip instantly without even hearing the song.

I hope this feature can be implemented in a future release in a form or another. Thanks a bunch in advance!

ungive commented 1 month ago

I need some more information. What exactly is the problem with "passing the information when it is not needed"? How exactly would you define that the information is "not needed"? At what point does it need to show up in the status for you?

Do you want it to appear e.g. only if it has been playing for 5 seconds? In that case, do you want every song to be showing up after 5 seconds and no earlier, even when you're not skipping? Personally I'd find that pretty annoying.

My suggestion is to just limit how often it updates the status, e.g. at most 1 time per 5 seconds.

Thanks in advance!

ungive commented 1 month ago

With the next version (2.1.0) Discord presence updates will be subject to the following limitations:

Navigate to %APPDATA%\Roaming\Music Presence on Windows (or ~/Library/Application Support/Music Presence on Mac) and open settings.json, you will find the following lines:

  "experimental": {
    "presence_update_limiter_count": null,
    "presence_update_limiter_time_frame": null
  },

Change the null values to numbers. For a limit of 1 presence update within 10 seconds, change it to the following:

  "experimental": {
    "presence_update_limiter_count": 1,
    "presence_update_limiter_time_frame": 10000
  },

Note that any settings that are part of "experimental" are not permanent and may be removed or change meaning in future versions without notice. They only exist so users can play around with some parameters and give feedback.

@poetryofcode If you were looking for a deliberate delay before every presence update, then please let me know! That will be extra work and I personally don't see the appeal, but I'm happy to be convinced otherwise. Cheers!

poetryofcode commented 1 month ago

@poetryofcode If you were looking for a deliberate delay before every presence update, then please let me know! That will be extra work and I personally don't see the appeal, but I'm happy to be convinced otherwise. Cheers!

Hey!

Sorry for the late reply, I wanted to reply yesterday but I have been busy and tired with my own stuff.

My main concern was going over API limits so your solution of a hard limit for updates has essentially solved that.

Also, the additional configurable limit is greatly appreciated and it matches my needs.

Thanks!

ungive commented 1 month ago

Implemented in version 2.1.0, the release for it can be found here.