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:
parent
5877f773aa
commit
48d6af0281
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue