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

Use MPRIS instead of proprietary spotify hooks #31

Open
draxaris1010 opened this issue Nov 21, 2024 · 2 comments
Open

Use MPRIS instead of proprietary spotify hooks #31

draxaris1010 opened this issue Nov 21, 2024 · 2 comments

Comments

@draxaris1010
Copy link

draxaris1010 commented Nov 21, 2024

When looking at pull request from librespot, I've seen someone is working on MPRIS support.
See pull request 1341 on librespot
MPRIS is a standard way on linux of letting other applications know and control (play/pause, skip/previous song) what music is playing.
This is done by sending the song title, artist and even location to thumbnail via D-Bus.
The specification of MPRIS can be found here: https://specifications.freedesktop.org/mpris-spec/latest/

@draxaris1010
Copy link
Author

Also there is a library in go that implements MPRIS
https://pkg.go.dev/github.com/rmrobinson/go-mpris

@Topvennie
Copy link
Contributor

Topvennie commented Nov 22, 2024

Unfortunately I don’t see how implementing MPRIS would help us avoid using Spotify.

Currently, the librespot library uses a hook to send a POST request to SCC whenever a new song starts, including its Spotify ID. SCC then fetches additional information from Spotify, which currently includes:

  • Track name
  • Artists

In the rewrite branch, this expands to include:

  • Track length
  • Lyrics (coming soon)
  • Genre (coming soon)

MPRIS doesn't provide all the data that SCC requires. As a result, a Spotify API request would still be necessary.

While alternative music sources could be used, it's worth mentioning that librespot is fundamentally a Spotify client library (and only for premium users). Therefore I think some additional requests won't hurt ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants