ZeusWPI / SCC

Screen Cammie Chat
MIT License
0 stars 0 forks source link

Use MPRIS instead of proprietary spotify hooks #31

Open draxaris1010 opened 1 day ago

draxaris1010 commented 1 day ago

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 commented 9 hours ago

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

Topvennie commented 8 hours ago

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:

In the rewrite branch, this expands to include:

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 ;)