1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +02:00

fix(music): showing when no mpris player found

THe music module expects an event to be sent on subscription to the
client to set up the initial state. This ensures an event is sent when
in MPRIS mode when no player is initially found.
This commit is contained in:
Jake Stanger 2023-05-21 20:44:31 +01:00
parent 5877f773aa
commit 48d6af0281

View file

@ -231,6 +231,16 @@ impl MusicClient for Client {
if let Err(err) = Self::send_update(&player, &self.tx) {
error!("{err:?}");
}
} else {
let status = Status {
playlist_position: 0,
playlist_length: 0,
state: PlayerState::Stopped,
elapsed: None,
duration: None,
volume_percent: 0,
};
send!(self.tx, PlayerUpdate::Update(Box::new(None), status));
}
rx