diff --git a/src/main.rs b/src/main.rs index 6bde200..fdb1d74 100644 --- a/src/main.rs +++ b/src/main.rs @@ -365,7 +365,7 @@ fn main() -> Result<(), String> { spotify.update_status(state.clone()); #[cfg(feature = "mpris")] - mpris_manager.update()?; + mpris_manager.update(); #[cfg(unix)] ipc.publish(&state, queue.get_current()); diff --git a/src/mpris.rs b/src/mpris.rs index 8f0fee9..89ad514 100644 --- a/src/mpris.rs +++ b/src/mpris.rs @@ -484,7 +484,12 @@ impl MprisManager { let (tx, rx) = mpsc::unbounded_channel::<()>(); - ASYNC_RUNTIME.spawn(Self::serve(UnboundedReceiverStream::new(rx), root, player)); + ASYNC_RUNTIME.spawn(async { + let result = Self::serve(UnboundedReceiverStream::new(rx), root, player).await; + if let Err(e) = result { + log::error!("MPRIS error: {e}"); + } + }); MprisManager { tx } } @@ -518,7 +523,9 @@ impl MprisManager { } } - pub fn update(&self) -> Result<(), String> { - self.tx.send(()).map_err(|e| e.to_string()) + pub fn update(&self) { + if let Err(e) = self.tx.send(()) { + log::warn!("Could not update MPRIS state: {e}"); + } } }