ungive / discord-music-presence

The Discord music status that works with any media player
https://musicpresence.app
Other
211 stars 2 forks source link

Pause handling & new possible configuration option #40

Closed NocFA closed 1 month ago

NocFA commented 1 month ago

Is there an existing issue for this?

Describe the problem

At present once a track is paused, the rich presence disappears from your profile immediately.

Solution

The first portion of this suggestion is to make this not happen, it'd be nice if the rich presence remained even when the track is paused, only dismissing it upon application closure (media player)

Secondly, this goes with the above; instead of showing the player on the small image, show a play/pause icon depending on the state regarding the above, scrobbler can remain, just, static until resume state, it seemingly already handles keeping its place upon resuming.; it'd

Alternatives

It may be worth adding the option to switch between static player icon & play/pause icons, when the player option is selected, maybe revert to old behaviour, as, some people might like the way it is now.

Additional context

No response

ungive commented 1 month ago

scrobbler can remain, just, static until resume state, it seemingly already handles keeping its place upon resuming.; it'd

What do you mean by that? Do you mean scrobbling to LastFM? Music Presence does not do any scrobbling at this time.

The first portion of this suggestion is to make this not happen, it'd be nice if the rich presence remained even when the track is paused, only dismissing it upon application closure (media player)

That's definitely possible. I could add an option "leave status active until the player is closed" (or presence is deactivated).

instead of showing the player on the small image, show a play/pause icon depending on the state regarding the above

I intend to always show the player icons for streaming services at the moment. As for offline media players, I could theoretically add the option to show playing/paused icons. I assume you're coming from the LastFM Discord integration which has that feature?

I'll put this together with another feature that was requested in the Discord, which is to allow for using "format strings" to customize the text that is shown (e.g. "{artist} - {title}"). I could allow to set the small image to a custom URL.

I'll open another issue for that.

NocFA commented 1 month ago

What do you mean by that? Do you mean scrobbling to LastFM? Music Presence does not do any scrobbling at this time.

Ah, apologies, the word scrobble has a different meaning to me, as, I am a LastFM user :P By scrobbler, I meant the playback duration handler, which, Discord has finally started showing when "listening to" is being used! So, to clarify, that specific playback duration bar, when the player is paused, can simply pause, I would think.

As for the rest, that sounds reasonable to always show the player, however, it would be nice to instead have play & pause icons as a choice, I understand that it's not up to me, appreciate the work you've done, I shall be sponsoring this project soon, just trial running it and it seems like a major successor to all the prior implements of non-agnostic playback rich presence handlers.

ungive commented 1 month ago

By scrobbler, I meant the playback duration handler, which, Discord has finally started showing when "listening to" is being used!

Ahh, thanks for clarifying!

So, to clarify, that specific playback duration bar, when the player is paused, can simply pause, I would think.

I'm afraid that can't realistically be done as the timestamps that are used are "absolute" in time (start time is e.g. 20:13:45 o'clock, end time is 20:15:59 o'clock) which is then used by discord to determine the current progress bar offset. One would have to update the status every second for the progress bar to be "stuck in time" or fixed at a specific position. While that might work, it would probably be jumping around by a second at best + the status may only be updated 5 times per 20 seconds, which makes this infeasible. Would be awesome though if that was possible!

If I'd add the option to use format strings as in the example I gave, then one could show "Paused" on the third line e.g. if the player is paused (in place of the album).

it would be nice to instead have play & pause icons as a choice

I'll keep that in mind when I add format strings!

appreciate the work you've done, I shall be sponsoring this project soon, just trial running it and it seems like a major successor to all the prior implements of non-agnostic playback rich presence handlers.

Thank you! I really appreciate that :) My goal is to make Music Presence the de-facto replacement for all those half-baked rich presence implementations, which work but usually aren't very feature-complete or require additional steps to work.

ungive commented 1 month ago

@NocFA Implemented the changes, please let me know your thoughts before I publish them!

The tray icon will also reflect when the status is showing paused media.

Note: This feature will only be available for offline music players for now. I always want to show the brand of the streaming service if a streaming service is playing the media, to make sure I'm crediting the source of the cover image properly whenever I can next to crediting the artist.

Playing: image image

Paused: image image

Paused (with the option to show how long it's paused, for those who want it): image

Same in Discord light mode: image image

What the icon looks like in light mode with a lighter cover image: image image

Hovering over the icon shows the appropriate text as well: image image

ungive commented 1 month ago

Modified appearance menu, also moved the setting to hide the player logo down:

image

NocFA commented 1 month ago

That is a beautifully clean implement indeed, strictly visually speaking, it looks perfect.

I don't assume you've added in the ability to permit pausing of streaming services while retaining RPC?

This is, to clarify without modifying the small image, just purely don't remove RPC when paused, yeet the seeker, just have static element until resumed.

Very nice work good sir.

ungive commented 1 month ago

That is a beautifully clean implement indeed, strictly visually speaking, it looks perfect.

Thanks!

This is, to clarify without modifying the small image, just purely don't remove RPC when paused, yeet the seeker, just have static element until resumed.

My thinking was it doesn't look very nice without the paused icon but I could have enabled it for those that want it, yeah. I think I'll just do that in the next update, i.e. move "Show paused media in your status", "Show a paused icon when music is paused" and "Show for how long media is paused" out of the "Settings for offline music players" category.

I usually wait at least a week between updates, I hope that's okay :) I'll @ you here when it's out, but you'll get an in-app pop-up as well when the update is here!

You're welcome to join the Discord btw (if you haven't already), would love to have you!

NocFA commented 1 month ago

Perfection, and, of course understood regarding the release staggering. Thanks for the hard work, I've joined the Discord, and I shall be shooting a sponsor your way.

ungive commented 1 month ago

Fully implemented now, version 2.2.4 allows you to pause media with streaming services as well.

Thanks for the sponsor!