diff --git a/src/helpers/boosted.rs b/src/helpers/boosted.rs index 8b4b157..59c5ccb 100644 --- a/src/helpers/boosted.rs +++ b/src/helpers/boosted.rs @@ -33,6 +33,7 @@ pub async fn send_boosted_event( let state = BoostedRideUpdate { riding: in_ride, + current_ride: json.current_ride, latest_ride: json.latest_ride, stats: json.stats, }; diff --git a/src/services/boosted/structs.rs b/src/services/boosted/structs.rs index 0451086..dcf72ea 100644 --- a/src/services/boosted/structs.rs +++ b/src/services/boosted/structs.rs @@ -2,10 +2,18 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug)] pub struct BoostedStats { + pub current_ride: CurrentRideStats, pub latest_ride: RideStats, pub stats: Stats, } +#[derive(Serialize, Deserialize, Debug)] +pub struct CurrentRideStats { + pub started_at: String, + pub duration: f64, + pub distance: f64, +} + #[derive(Serialize, Deserialize, Debug)] pub struct RideStats { pub started_at: String, diff --git a/src/structs/boosted.rs b/src/structs/boosted.rs index fbd9683..9c23812 100644 --- a/src/structs/boosted.rs +++ b/src/structs/boosted.rs @@ -1,12 +1,15 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; -use crate::services::boosted::structs::{RideStats, Stats}; +use crate::services::boosted::structs::{ + CurrentRideStats, RideStats, Stats, +}; #[skip_serializing_none] #[derive(Debug, Serialize, Deserialize)] pub struct BoostedRideUpdate { pub riding: bool, + pub current_ride: CurrentRideStats, pub latest_ride: RideStats, pub stats: Stats, }