From 8d1f4df194fb49f77044f5fdd0f6d9f39cdbcff4 Mon Sep 17 00:00:00 2001 From: Michael Herger Date: Fri, 27 Sep 2024 07:36:54 +0200 Subject: [PATCH] Don't send some of the noisier events back to LMS if they're ignored in LMS anyway. --- src/player_event_handler.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/player_event_handler.rs b/src/player_event_handler.rs index dc9a21e65..cd9fce183 100644 --- a/src/player_event_handler.rs +++ b/src/player_event_handler.rs @@ -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(); @@ -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"); } }