Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ungive opened this issue Sep 23, 2024 · 10 comments
Open
Labels
enhancement New feature or request needs settings window This feature needs a settings window

Comments

@ungive
Copy link
Owner

ungive commented Sep 23, 2024

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:

  • Users can make their status appear just the way they want
  • Makes Music Presence stand out from other presence implementations and the official Spotify integration

Cons:

  • The Discord status that is created by Music Presence may lose its uniform look
  • People could put offensive text into the status, which then might have show the button "Get this status" which would then possibly link the brand "Music Presence" with that offensive text, which is not very desirable. Theoretically users could already do that though by modifying an MP3's metadata, which is out of my control. So this is really a non-issue.
  • I can't make this feature experimental/temporary if I add it for all users. If I were to remove it again, reduce it's functionality or change it in some significant way in the future, some number of users could be inclined to downgrade Music Presence, just to be able to keep using it the way it was, which is something I want to avoid (i.e. avoid users being both dissatisfied and preferring to use an older version over the latest version).

Questions:

  • Who is responsible for the text that is shown in a Discord status? What if offensive text is in there? What if e.g. a NSFW cover image is shown in that status? Is it the responsibility of the Discord user or the application developer? The fact that anyone can use someone elses Discord Application ID makes me think it can't be the responsibility of the developer what is shown in a status.

Options:

  • Make this feature accessible for everyone right away. I might lose the ability to change it significantly or remove parts of it again without risking the points above.
  • Only make this feature accessible to Patreon members (at the very least until it's mature enough to go live for everyone). The status will look uniform for the majority of users, but those that want more customization can get it by subscribing to the cheapest Patreon tier. Additionally I get the option to disable the feature again, including for older versions (if it's absolutely necessary), since the feature would be dependent on authentication and it could be controlled server-side.
  • Do not implement this at all. Not really an option, would be wasted potential.
@ungive ungive added the enhancement New feature or request label Sep 23, 2024
@ungive
Copy link
Owner Author

ungive commented Sep 24, 2024

Format variables:

  • title: song title
  • artist: song artist(s)
  • album: song album name
  • player: the name of the player

Format strings (default):

  • title (1): "{title}"
  • subtitle (2): "{artist}"
  • extra (3): "{album}"
  • image_text: "{album}"

When paused (example):

  • title (1): "{title}"
  • subtitle (2): "{artist}"
  • extra (3): "Paused"
  • image_text: "{album}"

Notes:

  • "title" is the first line (or the second line when using the "Playing" type), "subtitle" is the line below that and "extra" is used as the third line with "Listening to" only and will be used as image text as well (that's how Discord displays it at the moment)
  • "when paused" is used inplace of the original format strings when the song is paused and if showing the status while paused is enabled

Todo:

  • Escape curly braces? See https://fmt.dev/9.0.0/syntax.html (Use {{ and }})
  • Use something other than curly braces? Might be hard to find on some keyboards.
  • Using the player ({player}) e.g. in the "title" for the "Listening to" activity type to mimic the Playing listening type will show the player name twice when switching to the "Playing" activity type. The user would have to change all format strings (or shift them). Add the option for profiles between activity types? One profile for "Listening" and one for "Playing"?

@PapitaConPure PapitaConPure mentioned this issue Sep 29, 2024
1 task
@ungive ungive added the needs settings window This feature needs a settings window label Oct 21, 2024
@ungive
Copy link
Owner Author

ungive commented Nov 2, 2024

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: ungive/foo_mediacontrol#1

@ungive
Copy link
Owner Author

ungive commented Nov 2, 2024

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
Copy link

saminationdj commented Nov 3, 2024

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
Copy link

kam106 commented Nov 3, 2024

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
Copy link
Owner Author

ungive commented Nov 3, 2024

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
Copy link

saminationdj commented Nov 3, 2024

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
Copy link

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
Copy link
Owner Author

ungive commented Nov 4, 2024

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.

  • Title: $if2([%vis title%],$if([%eng title%],$if2([%nat title%],%title%) '('%eng title%')',$if([%rom title%],$if2([%nat title%],%title%) '('%rom title%')',$if([%nat title%],%nat title% '('%title%')',[%title%]))))
  • Album: %album% (%year%) = "AlbumName (2002)"
  • ...

Music Presence has simpler variables:

  • Title: %title%
  • Album: %album% = "AlbumName (2002)"

@kam106
Copy link

kam106 commented Nov 4, 2024

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.

@ungive ungive mentioned this issue Nov 12, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs settings window This feature needs a settings window
Projects
Status: Backlog
Development

No branches or pull requests

3 participants