Skip to content

Commit

Permalink
Don't send some of the noisier events back to LMS if they're ignored …
Browse files Browse the repository at this point in the history
…in LMS anyway.
  • Loading branch information
michaelherger committed Sep 27, 2024
1 parent d5b159a commit 8d1f4df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/player_event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ fn run_program(env_vars: HashMap<&str, String>, onevent: &str) {

#[cfg(feature = "spotty")]
fn call_lms(env_vars: HashMap<&str, String>, onevent: &str) {
// don't send noisy position correction
if env_vars.get("PLAYER_EVENT") == Some(&"position_correction".to_string()) {
debug!("Ignoring {:?} event", env_vars.get("PLAYER_EVENT").unwrap());
return;
}

let mut params = onevent.split("|");

let host_port = params.next();
Expand Down Expand Up @@ -368,6 +374,6 @@ fn call_lms(env_vars: HashMap<&str, String>, onevent: &str) {
let _ = client.request(req).await;
});
} else {
eprint!("missing LMS connection params");
error!("missing LMS connection params");
}
}

0 comments on commit 8d1f4df

Please sign in to comment.