mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #1341] [CLOSED] Draft: Add MPRIS support #1345
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1345
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/1341
Author: @wisp3rwind
Created: 9/18/2024
Status: ❌ Closed
Base:
dev← Head:add-mpris📝 Commits (4)
949a886Allow cloning SPIRC055e0d8add release date to AudioItem8093981add Spirc.seek_offset commandde5a296add initial MPRIS support using zbus📊 Changes
7 files changed (+1263 additions, -1 deletions)
View changed files
📝
Cargo.lock(+3 -0)📝
Cargo.toml(+6 -1)📝
connect/src/spirc.rs(+28 -0)📝
metadata/src/audio/item.rs(+4 -0)📝
src/main.rs(+20 -0)➕
src/mpris_event_handler.rs(+1197 -0)📝
src/player_event_handler.rs(+5 -0)📄 Description
I've been playing around with adding MPRIS support to librespot, i.e. have it implement the
org.mpris.MediaPlayer2interface on DBus. Other software (such as the CLI toolplayerctl, or a service managing a smart speaker, as for example in HifiBerryOS or similar projects) can use this to obtain playback status, metadata and to control the player.This is achieved by hooking into the existing
PlayerEvents and sendingspirccommands.Currently, this is a working implementation (at least I've tested manually using
playerctl), but a few things are missing (at least doc + changelog updates, runcargo fmt+cargo clippy, only compile this on systems which support DBus, check implementation again against the MPRIS specification).Thus, I'm not really asking for detailed feedback yet, but I'd be curious to know:
zbusrequired for the feature.) Should it be configurable whether the MPRIS service runs from the command line?spirccommand that I added?The PR adds quite a lot of code, but this is almost exclusively contained in the new MPRIS task. Changes to existing components are quite minimal.
Thanks!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.