diff --git a/src/main.rs b/src/main.rs index e875f00..b73dc2f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,7 @@ fn handle_signal(data: &Data) { } } -/// This function contains the default maim loop body of the program. +/// This function contains the default main loop body of the program. /// It updates the active player, updates the output strings based on this, and finally formats and outputs these strings to stdout. /// /// input: diff --git a/src/update_players.rs b/src/update_players.rs index 7b76169..a6fe9ea 100644 --- a/src/update_players.rs +++ b/src/update_players.rs @@ -38,14 +38,14 @@ pub fn update_players(pf: &PlayerFinder, cfg: &Config, data: &mut Data) { data.current_player = None; debug!("update_players: no players found!") } else { - let mut trees = vec![BTreeMap::new(), BTreeMap::new()]; + let mut trees = vec![BTreeMap::new(), BTreeMap::new(), BTreeMap::new()]; for player in players { if let Ok(status) = player.get_playback_status() { let idx = cfg.find_player_priorities_idx(player.identity()); match status { mpris::PlaybackStatus::Playing => trees[0].insert(idx, player), - mpris::PlaybackStatus::Paused => trees[0].insert(idx, player), - mpris::PlaybackStatus::Stopped => trees[1].insert(idx, player), + mpris::PlaybackStatus::Paused => trees[1].insert(idx, player), + mpris::PlaybackStatus::Stopped => trees[2].insert(idx, player), }; } }