Skip to content

Commit 1098afd

Browse files
committed
remove mpris feature
1 parent 9a42914 commit 1098afd

File tree

8 files changed

+10
-481
lines changed

8 files changed

+10
-481
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Special color for unavailable items
1313
- changelog with all the relevant user-facing changes to the project
14-
- Media control keys support for Windows and macOS
14+
- Replaced `mpris` with `media_control` feature providing universal support for media keys
1515

1616
### Changed
1717

Cargo.lock

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ toml = "0.8"
6161
unicode-width = "0.1.9"
6262
url = "2.2"
6363
winit = { version = "0.28.6", optional = true }
64-
zbus = {version = "3.11.1", default-features = false, features = ["tokio"], optional = true}
6564

6665
[target.'cfg(target_os = "linux")'.dependencies]
6766
wl-clipboard-rs = {version = "0.8", optional = true}
@@ -81,7 +80,7 @@ version = "0.20.0"
8180
[dependencies.notify-rust]
8281
default-features = false
8382
version = "4"
84-
# Use zbus, which we already depend on, instead of dbus.
83+
# Use zbus
8584
features = ["z"]
8685
optional = true
8786

@@ -100,7 +99,6 @@ alsa_backend = ["librespot-playback/alsa-backend"]
10099
cover = ["ioctl-rs"] # Support displaying the album cover
101100
default = ["share_clipboard", "pulseaudio_backend", "media_control", "notify", "crossterm_backend"]
102101
media_control = ["souvlaki", "winit", "windows"]
103-
mpris = ["zbus"] # Allow ncspot to be controlled via MPRIS API
104102
ncurses_backend = ["cursive/ncurses-backend"]
105103
notify = ["notify-rust"] # Show what's playing via a notification
106104
crossterm_backend = ["cursive/crossterm-backend"]

doc/developers.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,12 @@ cargo build --no-default-features --features rodio_backend,pancurses_backend,med
7272
## Other Features
7373
Here are some auxiliary features you may wish to enable:
7474
75-
| Feature | Default | Description |
76-
|-------------------|---------|--------------------------------------------------------------------------------------------|
77-
| `cover` | off | Add a screen to show the album art. |
78-
| `media_control` | on | Control `ncspot` via media keys. |
79-
| `mpris` | off | Control `ncspot` via dbus. See [Arch Wiki: MPRIS](https://wiki.archlinux.org/title/MPRIS). |
80-
| `notify` | on | Send a notification to show what's playing. |
81-
| `share_clipboard` | on | Ability to copy the URL of a song/playlist/etc. to system clipboard. |
75+
| Feature | Default | Description |
76+
|-------------------|---------|----------------------------------------------------------------------|
77+
| `cover` | off | Add a screen to show the album art. |
78+
| `media_control` | on | Control `ncspot` via media keys. |
79+
| `notify` | on | Send a notification to show what's playing. |
80+
| `share_clipboard` | on | Ability to copy the URL of a song/playlist/etc. to system clipboard. |
8281

8382
Consult [Cargo.toml](/Cargo.toml) for the full list of supported features.
8483

doc/users.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ cargo install --locked ncspot
5555

5656
## Key Bindings
5757
The keybindings listed below are configured by default. Additionally, if you
58-
built `ncspot` with `media_control` or `mpris` feature, you may be able to use media keys to control
58+
built `ncspot` with `media_control` feature, you may be able to use media keys to control
5959
playback depending on your desktop environment settings. Have a look at the
6060
[configuration section](#configuration) if you want to set custom bindings.
6161

@@ -180,7 +180,7 @@ Note: \<FOO\> - mandatory arg; [BAR] - optional arg
180180
| `save [current]` | Save selected item, if `current` is passed the currently playing item will be saved |
181181

182182
## Remote control (IPC)
183-
Apart from MPRIS, ncspot will also create a domain socket on UNIX platforms (Linux, macOS, *BSD).
183+
Application will create a domain socket on UNIX platforms (Linux, macOS, *BSD).
184184
The socket will be created in the platform's runtime directory. If XDG_RUNTIME_DIR is set, it will
185185
be created under `$XDG_RUNTIME_DIR/ncspot`. If XDG_RUNTIME_DIR isn't set, it will be created under
186186
`/run/user/<uid>` for Linux if it exists. In all other cases, it will be created under

src/application.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ use crate::{command, queue, spotify};
2323
#[cfg(feature = "media_control")]
2424
use crate::media_control::{self, MediaControlManager};
2525

26-
#[cfg(feature = "mpris")]
27-
use crate::mpris::{self, MprisManager};
28-
2926
#[cfg(unix)]
3027
use crate::ipc::{self, IpcSocket};
3128

@@ -73,9 +70,6 @@ pub struct Application {
7370
/// Use media control keys using souvlaki.
7471
#[cfg(feature = "media_control")]
7572
media_control_manager: MediaControlManager,
76-
/// An IPC implementation using the D-Bus MPRIS protocol, used to control and inspect ncspot.
77-
#[cfg(feature = "mpris")]
78-
mpris_manager: MprisManager,
7973
/// An IPC implementation using a Unix domain socket, used to control and inspect ncspot.
8074
#[cfg(unix)]
8175
ipc: IpcSocket,
@@ -140,14 +134,6 @@ impl Application {
140134
media_control::MediaControlManager::new(spotify.clone(), queue.clone())
141135
.map_err(|err| -> String { format!("media_control error {err:?}") })?;
142136

143-
#[cfg(feature = "mpris")]
144-
let mpris_manager = mpris::MprisManager::new(
145-
event_manager.clone(),
146-
queue.clone(),
147-
library.clone(),
148-
spotify.clone(),
149-
);
150-
151137
#[cfg(unix)]
152138
let ipc = ipc::IpcSocket::new(
153139
ASYNC_RUNTIME.get().unwrap().handle(),
@@ -213,8 +199,6 @@ impl Application {
213199
event_manager,
214200
#[cfg(feature = "media_control")]
215201
media_control_manager,
216-
#[cfg(feature = "mpris")]
217-
mpris_manager,
218202
#[cfg(unix)]
219203
ipc,
220204
cursive,
@@ -248,9 +232,6 @@ impl Application {
248232
#[cfg(feature = "media_control")]
249233
self.media_control_manager.update();
250234

251-
#[cfg(feature = "mpris")]
252-
self.mpris_manager.update();
253-
254235
#[cfg(unix)]
255236
self.ipc.publish(&state, self.queue.get_current());
256237

src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ mod ipc;
3939
#[cfg(feature = "media_control")]
4040
mod media_control;
4141

42-
#[cfg(feature = "mpris")]
43-
mod mpris;
44-
4542
fn main() -> Result<(), String> {
4643
// Set a custom backtrace hook that writes the backtrace to a file instead of stdout, since
4744
// stdout is most likely in use by Cursive.

0 commit comments

Comments
 (0)