fix: MPRIS loop tokio::select!() panic on exit

This fixes a bug that would cause a panic when quiting the process
normally. `tokio::select!()` was used to await a single branch, which is
useless as it can be replaced by a normal await.
This commit is contained in:
Thomas Frans
2023-10-04 11:51:52 +02:00
committed by Henrik Friedrichsen
parent 51d1b34ccc
commit 8d00ca74fc

View File

@@ -513,15 +513,12 @@ impl MprisManager {
let player_iface = player_iface_ref.get().await; let player_iface = player_iface_ref.get().await;
loop { loop {
tokio::select! { rx.next().await;
Some(()) = rx.next() => {
let ctx = player_iface_ref.signal_context(); let ctx = player_iface_ref.signal_context();
player_iface.playback_status_changed(ctx).await?; player_iface.playback_status_changed(ctx).await?;
player_iface.metadata_changed(ctx).await?; player_iface.metadata_changed(ctx).await?;
} }
} }
}
}
pub fn update(&self) { pub fn update(&self) {
if let Err(e) = self.tx.send(()) { if let Err(e) = self.tx.send(()) {