ungive / discord-music-presence

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

Add fine-grained control over what the status looks like with format strings #42

Open ungive opened 1 month ago

ungive commented 1 month ago

It would be nice to be able to customize your status in perfect detail by controlling exactly where each piece of information goes, e.g. with the use of format strings. Example: Playing {title} - {artist} which replaces variables in curly braces with actual song metadata.

Pros:

Cons:

Questions:

Options:

ungive commented 1 month ago

Format variables:

Format strings (default):

When paused (example):

Notes:

Todo:

ungive commented 2 weeks ago

This might have to work in conjunction with the media player for formatting options that just can't be expressed/communicated through system APIs like SMTC on Windows or MediaRemote on Mac. Example: foobar2000 formats the "title" based on the preferred localization (original, localized, romanized) or it sets the "album" field on Windows with information about bitrate. There can only be one title with SMTC on Windows and there is no field for bitrate with that API. Setting "%album% - %bitrate% %khz%" for the album in foobar2000 using the foo_mediacontrol plugin (basically reporting more than just album in the album field) and then using merely "%album%" within Music Presence would allow to show additional information without relying on system APIs having fields for that information.

Of course this sort of abuses the system API by reporting a somewhat wrong value for the album in the above example, but that shouldn't ever become a serious problem.

See also: https://github.com/ungive/foo_mediacontrol/issues/1

ungive commented 2 weeks ago

Also: The option to customize the small icon in the bottom right corner would be nice too, e.g. a custom MusicBee icon. This should only be available for non-streaming services/offline media players.

saminationdj commented 2 weeks ago

Continuing the discussion from the foobar subreddit :)

It might create a hassle for you, but I think it would be better if you use whatever the media player itself uses, and let the player create the string before your plugins sends it to Music Presence. Most players allow for custom tags, which I might want to use, but that would give you problem if you need to think of every single custom tag. On Foobar for example, I use %CATNR% for Vinyl records or certain CDs, as well %MYDATE% and %MYSOURCE% for when I bought/ripped it and were it's from.

Not to mention MusicBee's enforcing you to declare the custom tags for EVERY format you use (while %NAME% that foobar doesn't recognize are considered to be custom tags automatically)

kam106 commented 2 weeks ago

Plus one for this! I use %SORTGROUP% to distinguish album editions from eachother and various other custom tags such as %scrobbleasartist% to do a bunch of internal things, like say, scrobbling an album correctly but keeping the ratings separate (a Spider Monkey Panel limitation requires me to do this)!

ungive commented 2 weeks ago

Just to make sure I understand correctly: Do you mean that you want to use these variables you mentioned (%CATNR%, %SORTGROUP%, etc.) within Music Presence? i.e. that foobar2000 or MusicBee sets these variables to values and then "sends" them to Music Presence and you use them universally in Music Presence?

saminationdj commented 2 weeks ago

Not you per se, but let the media player itself parse the variables. That way you wont have to create them yourself. Many different people use different custom tags after all, you can't cater to every single one of us :P

saminationdj commented 2 weeks ago

Plus one for this! I use %SORTGROUP% to distinguish album editions from eachother and various other custom tags such as %scrobbleasartist% to do a bunch of internal things, like say, scrobbling an album correctly but keeping the ratings separate (a Spider Monkey Panel limitation requires me to do this)!

Although SORTGROUP info is something I don't think needs to be sent. That's a variable needed for the player, not a "now playing" announcer.

kam106: As for scrobbling, do you use a different plugin to send %scrobblesartist% instead of %track artist%?

ungive commented 2 weeks ago

Alright, thanks for clarifying, that was the original idea I had in mind too!

Setting "%album% - %bitrate% %khz%" for the album in foobar2000 using the foo_mediacontrol plugin (basically reporting more than just album in the album field) and then using merely "%album%" within Music Presence would allow to show additional information without relying on system APIs having fields for that information.

So basically:

foobar2000 reports e.g.

Music Presence has simpler variables:

kam106 commented 2 weeks ago

Although SORTGROUP info is something I don't think needs to be sent. That's a variable needed for the player, not a "now playing" announcer.

I guess this is true. It's not really a necessity to be sent, but it would have been nice.

As for scrobbling, do you use a different plugin to send %scrobblesartist% instead of %track artist%?

Nope, I just have a very ugly $if hack on the artist field to check if there's %scrobbleasartist%, if not, use track artist.

PapitaConPure commented 1 week ago

I didn't see any mention of it so I'll mention it here as it's related to this issue. It'd be good to have a customizable button below/above the "Get this status" one. Both the label and the URL would be editable.

For example, it could be used to add a "See on last.fm" button, which would have a last.fm URL with some format variables to find the song and some arbitrary label chosen by the user.