diff --git a/src/cmd/discord/mod.rs b/src/cmd/discord/mod.rs index 2b05e88..082369f 100644 --- a/src/cmd/discord/mod.rs +++ b/src/cmd/discord/mod.rs @@ -63,7 +63,7 @@ async fn update_presence(client: &mut DiscordIpcClient, state: &mut ActivityStat return Ok(()); } - let position = position.parse::()?; + let position = position.replace(',', ".").parse::()?; let track = music::get_current_track() .await? diff --git a/src/cmd/now.rs b/src/cmd/now.rs index 7a2a3c9..a660574 100644 --- a/src/cmd/now.rs +++ b/src/cmd/now.rs @@ -98,6 +98,7 @@ async fn update_state( .map(|s| s.trim().to_owned()); let player_position = player_position + .replace(',', ".") .parse::() .ok() .map(|p| p + time_latency); diff --git a/src/main.rs b/src/main.rs index 8e17b92..264d994 100644 --- a/src/main.rs +++ b/src/main.rs @@ -116,6 +116,7 @@ async fn concise_now_playing() -> Result<()> { .next() .ok_or_else(|| eyre!("Could not obtain track duration"))? .to_owned() + .replace(',', ".") .parse::()?; println!( diff --git a/src/music/mod.rs b/src/music/mod.rs index 86356eb..38eaa81 100644 --- a/src/music/mod.rs +++ b/src/music/mod.rs @@ -161,6 +161,7 @@ pub async fn get_current_track() -> Result> { .next() .ok_or_else(|| eyre!("Could not obtain track duration"))? .to_owned() + .replace(',', ".") .parse::()?; Ok(Some(Track {