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

[new-feature-request] Adding rich presence buttons #32

Open
DestroyerAce opened this issue Oct 28, 2022 · 4 comments
Open

[new-feature-request] Adding rich presence buttons #32

DestroyerAce opened this issue Oct 28, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@DestroyerAce
Copy link

DestroyerAce commented Oct 28, 2022

It would be nice if there are rich presence buttons that shows link for what song you are playing on spotify or/and youtube

@JakeStanger JakeStanger added the enhancement New feature or request label Oct 28, 2022
@JakeStanger
Copy link
Owner

Happy to add this. MusicBrainz has info for Spotify/YouTube links so I can pull it from there. If it doesn't exist there though for a particular song, I think I'll have to fall back to not displaying them for now. The alternative would be to search and hope the result comes back correct, which would also require users to add API keys to their config.

@JakeStanger
Copy link
Owner

So I've had a look into this, and there are two big issues I see:

  • None of the Discord RPC libraries have button support currently. It can be patched in, but it seems to work in a bit of a weird way so it's a bit of work.
  • More importantly, very few tracks in the MusicBrainz database have streaming links.

My concern is that it'd be quite a bit of work to add a feature that would be visible a fraction of the time.

The immediate alternative method I see is to directly search YouTube/Spotify using their APIs, but as stated that would require users to obtain their own API keys and add them to the config, which I'm reluctant to add as a requirement and I suspect most people won't bother with. It also adds quite a lot more complexity to the program in general.

If yourself or anybody else has any other ideas, I'm happy to look into them and see if we can add it that way, but I'm going to have to halt this otherwise.

@natto1784
Copy link

There is one such library but it does not have the best code unfortunately. I have added a button as an example in my fork here. If you decide to use it, I would also recommend using the musicbrainz_rs crate.

@JakeStanger
Copy link
Owner

JakeStanger commented Nov 19, 2022

Looks like I must have missed that library when I was looking. This solves problem 1 nicely, so we're one step closer. Thanks for finding that!

The reason I'm not using a MusicBrainz library currently is that I can't see much advantage. I only need to perform a handful of basic HTTP requests at the moment and it doesn't feel like enough to warrant another dependency. If the scope of MusicBrainz integration ever expands, I'll definitely migrate over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants