chore(deps): bump the cargo group with 3 updates

* chore(deps): bump the cargo group with 3 updates

Bumps the cargo group with 3 updates: [clap](https://github.com/clap-rs/clap), [zbus](https://github.com/dbus2/zbus) and [clap_complete](https://github.com/clap-rs/clap).


Updates `clap` from 4.5.0 to 4.5.1
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.0...clap_complete-v4.5.1)

Updates `zbus` from 3.15.0 to 4.0.1
- [Release notes](https://github.com/dbus2/zbus/releases)
- [Commits](https://github.com/dbus2/zbus/compare/zbus-3.15.0...zbus-4.0.1)

Updates `clap_complete` from 4.5.0 to 4.5.1
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.0...clap_complete-v4.5.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: zbus
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: cargo
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: `cargo update`

* chore: migrate to zbus v4 macros

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
dependabot[bot]
2024-02-23 22:39:00 +00:00
committed by GitHub
parent 5b4a17597d
commit 0007bf6de2
4 changed files with 536 additions and 342 deletions

816
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -37,10 +37,10 @@ codegen-units = 16
[dependencies] [dependencies]
chrono = "0.4" chrono = "0.4"
clap = "4.5.0" clap = "4.5.1"
clipboard = {version = "0.5", optional = true} clipboard = {version = "0.5", optional = true}
crossbeam-channel = "0.5" crossbeam-channel = "0.5"
zbus = {version = "3.15.0", default-features = false, features = ["tokio"], optional = true} zbus = {version = "4.0.1", default-features = false, features = ["tokio"], optional = true}
fern = "0.6" fern = "0.6"
futures = "0.3" futures = "0.3"
ioctl-rs = {version = "0.2", optional = true} ioctl-rs = {version = "0.2", optional = true}

View File

@@ -7,7 +7,7 @@ use tokio::sync::mpsc;
use tokio_stream::wrappers::UnboundedReceiverStream; use tokio_stream::wrappers::UnboundedReceiverStream;
use tokio_stream::StreamExt; use tokio_stream::StreamExt;
use zbus::zvariant::{ObjectPath, Value}; use zbus::zvariant::{ObjectPath, Value};
use zbus::{dbus_interface, ConnectionBuilder}; use zbus::{interface, ConnectionBuilder};
use crate::application::ASYNC_RUNTIME; use crate::application::ASYNC_RUNTIME;
use crate::library::Library; use crate::library::Library;
@@ -29,34 +29,34 @@ use crate::{
struct MprisRoot {} struct MprisRoot {}
#[dbus_interface(name = "org.mpris.MediaPlayer2")] #[interface(name = "org.mpris.MediaPlayer2")]
impl MprisRoot { impl MprisRoot {
#[dbus_interface(property)] #[zbus(property)]
fn can_quit(&self) -> bool { fn can_quit(&self) -> bool {
false false
} }
#[dbus_interface(property)] #[zbus(property)]
fn can_raise(&self) -> bool { fn can_raise(&self) -> bool {
false false
} }
#[dbus_interface(property)] #[zbus(property)]
fn has_tracklist(&self) -> bool { fn has_tracklist(&self) -> bool {
true true
} }
#[dbus_interface(property)] #[zbus(property)]
fn identity(&self) -> &str { fn identity(&self) -> &str {
"ncspot" "ncspot"
} }
#[dbus_interface(property)] #[zbus(property)]
fn supported_uri_schemes(&self) -> Vec<String> { fn supported_uri_schemes(&self) -> Vec<String> {
vec!["spotify".to_string()] vec!["spotify".to_string()]
} }
#[dbus_interface(property)] #[zbus(property)]
fn supported_mime_types(&self) -> Vec<String> { fn supported_mime_types(&self) -> Vec<String> {
Vec::new() Vec::new()
} }
@@ -73,9 +73,9 @@ struct MprisPlayer {
spotify: Spotify, spotify: Spotify,
} }
#[dbus_interface(name = "org.mpris.MediaPlayer2.Player")] #[interface(name = "org.mpris.MediaPlayer2.Player")]
impl MprisPlayer { impl MprisPlayer {
#[dbus_interface(property)] #[zbus(property)]
fn playback_status(&self) -> &str { fn playback_status(&self) -> &str {
match self.spotify.get_current_status() { match self.spotify.get_current_status() {
PlayerEvent::Playing(_) | PlayerEvent::FinishedTrack => "Playing", PlayerEvent::Playing(_) | PlayerEvent::FinishedTrack => "Playing",
@@ -84,7 +84,7 @@ impl MprisPlayer {
} }
} }
#[dbus_interface(property)] #[zbus(property)]
fn loop_status(&self) -> &str { fn loop_status(&self) -> &str {
match self.queue.get_repeat() { match self.queue.get_repeat() {
RepeatSetting::None => "None", RepeatSetting::None => "None",
@@ -93,7 +93,7 @@ impl MprisPlayer {
} }
} }
#[dbus_interface(property)] #[zbus(property)]
fn set_loop_status(&self, loop_status: &str) { fn set_loop_status(&self, loop_status: &str) {
let setting = match loop_status { let setting = match loop_status {
"Track" => RepeatSetting::RepeatTrack, "Track" => RepeatSetting::RepeatTrack,
@@ -104,22 +104,22 @@ impl MprisPlayer {
self.event.trigger(); self.event.trigger();
} }
#[dbus_interface(property)] #[zbus(property)]
fn rate(&self) -> f64 { fn rate(&self) -> f64 {
1.0 1.0
} }
#[dbus_interface(property)] #[zbus(property)]
fn minimum_rate(&self) -> f64 { fn minimum_rate(&self) -> f64 {
1.0 1.0
} }
#[dbus_interface(property)] #[zbus(property)]
fn maximum_rate(&self) -> f64 { fn maximum_rate(&self) -> f64 {
1.0 1.0
} }
#[dbus_interface(property)] #[zbus(property)]
fn metadata(&self) -> HashMap<String, Value> { fn metadata(&self) -> HashMap<String, Value> {
let mut hm = HashMap::new(); let mut hm = HashMap::new();
@@ -254,23 +254,23 @@ impl MprisPlayer {
hm hm
} }
#[dbus_interface(property)] #[zbus(property)]
fn shuffle(&self) -> bool { fn shuffle(&self) -> bool {
self.queue.get_shuffle() self.queue.get_shuffle()
} }
#[dbus_interface(property)] #[zbus(property)]
fn set_shuffle(&self, shuffle: bool) { fn set_shuffle(&self, shuffle: bool) {
self.queue.set_shuffle(shuffle); self.queue.set_shuffle(shuffle);
self.event.trigger(); self.event.trigger();
} }
#[dbus_interface(property)] #[zbus(property)]
fn volume(&self) -> f64 { fn volume(&self) -> f64 {
self.spotify.volume() as f64 / 65535_f64 self.spotify.volume() as f64 / 65535_f64
} }
#[dbus_interface(property)] #[zbus(property)]
fn set_volume(&self, mut volume: f64) { fn set_volume(&self, mut volume: f64) {
log::info!("set volume: {volume}"); log::info!("set volume: {volume}");
volume = volume.clamp(0.0, 1.0); volume = volume.clamp(0.0, 1.0);
@@ -279,37 +279,37 @@ impl MprisPlayer {
self.event.trigger(); self.event.trigger();
} }
#[dbus_interface(property)] #[zbus(property)]
fn position(&self) -> i64 { fn position(&self) -> i64 {
self.spotify.get_current_progress().as_micros() as i64 self.spotify.get_current_progress().as_micros() as i64
} }
#[dbus_interface(property)] #[zbus(property)]
fn can_go_next(&self) -> bool { fn can_go_next(&self) -> bool {
self.queue.next_index().is_some() self.queue.next_index().is_some()
} }
#[dbus_interface(property)] #[zbus(property)]
fn can_go_previous(&self) -> bool { fn can_go_previous(&self) -> bool {
self.queue.get_current().is_some() self.queue.get_current().is_some()
} }
#[dbus_interface(property)] #[zbus(property)]
fn can_play(&self) -> bool { fn can_play(&self) -> bool {
self.queue.get_current().is_some() self.queue.get_current().is_some()
} }
#[dbus_interface(property)] #[zbus(property)]
fn can_pause(&self) -> bool { fn can_pause(&self) -> bool {
self.queue.get_current().is_some() self.queue.get_current().is_some()
} }
#[dbus_interface(property)] #[zbus(property)]
fn can_seek(&self) -> bool { fn can_seek(&self) -> bool {
self.queue.get_current().is_some() self.queue.get_current().is_some()
} }
#[dbus_interface(property)] #[zbus(property)]
fn can_control(&self) -> bool { fn can_control(&self) -> bool {
self.queue.get_current().is_some() self.queue.get_current().is_some()
} }

View File

@@ -7,8 +7,8 @@ edition = "2021"
[dependencies] [dependencies]
clap_mangen = "0.2.20" clap_mangen = "0.2.20"
clap_complete = "4.5.0" clap_complete = "4.5.1"
clap = "4.5.0" clap = "4.5.1"
[dependencies.ncspot] [dependencies.ncspot]
default-features = false default-features = false