Skip to content

Commit

Permalink
fix(mpris): Adapt to zbus 5.0.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hrkfdn committed Oct 31, 2024
1 parent 3741cf8 commit 9325f0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mpris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use std::time::Duration;
use tokio::sync::mpsc;
use tokio_stream::wrappers::UnboundedReceiverStream;
use tokio_stream::StreamExt;
use zbus::object_server::SignalContext;
use zbus::object_server::SignalEmitter;
use zbus::zvariant::{ObjectPath, Value};
use zbus::{interface, ConnectionBuilder};
use zbus::{connection, interface};

use crate::application::ASYNC_RUNTIME;
use crate::library::Library;
Expand Down Expand Up @@ -318,7 +318,7 @@ impl MprisPlayer {
}

#[zbus(signal)]
async fn seeked(context: &SignalContext<'_>, position: &i64) -> zbus::Result<()>;
async fn seeked(context: &SignalEmitter<'_>, position: &i64) -> zbus::Result<()>;

fn next(&self) {
self.queue.next(true)
Expand Down Expand Up @@ -521,7 +521,7 @@ impl MprisManager {
root: MprisRoot,
player: MprisPlayer,
) -> Result<(), Box<dyn Error + Sync + Send>> {
let conn = ConnectionBuilder::session()?
let conn = connection::Builder::session()?
.name(instance_bus_name())?
.serve_at("/org/mpris/MediaPlayer2", root)?
.serve_at("/org/mpris/MediaPlayer2", player)?
Expand All @@ -535,7 +535,7 @@ impl MprisManager {
let player_iface = player_iface_ref.get().await;

loop {
let ctx = player_iface_ref.signal_context();
let ctx = player_iface_ref.signal_emitter();
match rx.next().await {
Some(MprisCommand::EmitPlaybackStatus) => {
player_iface.playback_status_changed(ctx).await?;
Expand Down

0 comments on commit 9325f0e

Please sign in to comment.