From 4542f8c27868c2a9de5372c0fd3669489caf317d Mon Sep 17 00:00:00 2001 From: eladyn Date: Sun, 5 Jan 2025 13:30:29 +0100 Subject: [PATCH] mpris: do not erase current track on loading event --- src/dbus_mpris.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs index 0550ee22..3492409f 100644 --- a/src/dbus_mpris.rs +++ b/src/dbus_mpris.rs @@ -215,6 +215,7 @@ impl CurrentStateInner { let mut changed = DbusMap::new(); let mut seeked = false; let mut current_track_id = None; + debug!("handling event {event:?}"); match event { PlayerEvent::VolumeChanged { volume } => { @@ -268,7 +269,6 @@ impl CurrentStateInner { self.audio_item = Some(audio_item); insert_attr(&mut changed, "Metadata", self.to_metadata()); } - PlayerEvent::Loading { track_id, .. } => current_track_id = Some(track_id), PlayerEvent::PositionCorrection { track_id, position_ms, @@ -296,6 +296,7 @@ impl CurrentStateInner { ) } PlayerEvent::Preloading { .. } + | PlayerEvent::Loading { .. } | PlayerEvent::TimeToPreloadNextTrack { .. } | PlayerEvent::EndOfTrack { .. } | PlayerEvent::Unavailable { .. }