Sync your own workout data from your "Strong" app
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

renamed get_workout_id_from_link to get_measurement_id_from_link

tolik518 535e7c97 2fbc854c

+8 -8
+8 -8
strong-api-lib/src/data_transformer.rs
··· 117 117 return None; 118 118 } 119 119 120 - let workout_id = Self::get_workout_id_from_link(&cell_set_group.links); 120 + let measurement_id = Self::get_measurement_id_from_link(&cell_set_group.links); 121 121 122 - // Get workout name from measurements if available 122 + // Get exercise name from measurements if available 123 123 let name = lookup 124 - .get(&workout_id) 124 + .get(&measurement_id) 125 125 .map(|measurement| measurement.name.to_string()) 126 126 .unwrap_or_default(); 127 127 ··· 179 179 ) 180 180 } 181 181 182 - fn get_workout_id_from_link(links: &CellSetGroupLinks) -> String { 182 + fn get_measurement_id_from_link(links: &CellSetGroupLinks) -> String { 183 183 let url = match &links.measurement { 184 184 Some(link) => link.href.clone(), 185 185 None => return String::new(), ··· 197 197 use super::*; 198 198 199 199 #[test] 200 - fn test_can_get_workout_id_from_link() { 200 + fn test_can_get_measurement_id_from_link() { 201 201 let links = CellSetGroupLinks { 202 202 measurement: Some( 203 203 Link { ··· 208 208 209 209 assert_eq!( 210 210 "a3f1d57d-da0e-466d-a691-c03695d39418".to_string(), 211 - DataTransformer::get_workout_id_from_link(&links) 211 + DataTransformer::get_measurement_id_from_link(&links) 212 212 ); 213 213 } 214 214 215 215 #[test] 216 - fn test_can_get_workout_id_from_link_on_empty() { 216 + fn test_can_get_measurement_id_from_link_on_empty() { 217 217 let links = CellSetGroupLinks { 218 218 measurement: None, 219 219 }; 220 220 221 221 assert_eq!( 222 222 "".to_string(), 223 - DataTransformer::get_workout_id_from_link(&links) 223 + DataTransformer::get_measurement_id_from_link(&links) 224 224 ); 225 225 } 226 226 }