Skip to content

Commit

Permalink
mpris: do not erase current track on loading event
Browse files Browse the repository at this point in the history
  • Loading branch information
eladyn committed Jan 5, 2025
1 parent db5ce48 commit 4542f8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dbus_mpris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 } => {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -296,6 +296,7 @@ impl CurrentStateInner {
)
}
PlayerEvent::Preloading { .. }
| PlayerEvent::Loading { .. }
| PlayerEvent::TimeToPreloadNextTrack { .. }
| PlayerEvent::EndOfTrack { .. }
| PlayerEvent::Unavailable { .. }
Expand Down

0 comments on commit 4542f8c

Please sign in to comment.