diff --git a/Cargo.toml b/Cargo.toml index 96abb5c..fafaac1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-player" -version = "0.1.17" +version = "0.1.18" edition = "2021" [dependencies] diff --git a/src/main.rs b/src/main.rs index 033b300..406da7e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -183,8 +183,10 @@ async fn run_app( let new_position = player.get_position().unwrap_or(0.0); let new_duration = player.get_duration().unwrap_or(0.0); - // Only mark as changed if position moved by at least 0.5 seconds - if (new_position - last_position).abs() >= 0.5 { + // Only update if displayed value (rounded to seconds) changed + let old_display_secs = last_position as u32; + let new_display_secs = new_position as u32; + if new_display_secs != old_display_secs { state.current_position = new_position; last_position = new_position; state_changed = true;