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.

cargo fmt

+10 -5
+8 -3
strong-api-lib/src/data_transformer.rs
··· 1 - use crate::json_response::{CellSet, CellSetGroup, CellSetGroupLinks, Log, Measurement, MeasurementsResponse}; 1 + use crate::json_response::{ 2 + CellSet, CellSetGroup, CellSetGroupLinks, Log, Measurement, MeasurementsResponse, 3 + }; 2 4 use std::collections::HashMap; 3 5 4 6 #[derive(Debug)] ··· 55 57 }; 56 58 57 59 let lookup = self.create_measurement_lookup(); 58 - let workouts = logs.iter() 60 + let workouts = logs 61 + .iter() 59 62 .map(|log| self.process_log_to_workout(log, &lookup)) 60 63 .collect(); 61 64 ··· 126 129 127 130 fn process_cell_set_to_set(&self, cell_set: &CellSet) -> Option<Set> { 128 131 // Skip rest timers or notes 129 - if cell_set.cells.iter() 132 + if cell_set 133 + .cells 134 + .iter() 130 135 .any(|cell| matches!(cell.cell_type.as_str(), "REST_TIMER" | "NOTE")) 131 136 { 132 137 return None;
+1 -1
strong-api-lib/src/json_response.rs
··· 1 - use std::fmt; 2 1 use serde::{Deserialize, Serialize}; 3 2 use serde_json::Value; 3 + use std::fmt; 4 4 5 5 #[derive(Debug, Deserialize)] 6 6 pub struct ApiErrorResponse {
+1 -1
strong-api-lib/src/strong_api.rs
··· 1 - use crate::json_response::{ApiErrorResponse, LoginResponse, MeasurementsResponse}; 2 1 use crate::json_response::UserResponse; 2 + use crate::json_response::{ApiErrorResponse, LoginResponse, MeasurementsResponse}; 3 3 use reqwest::{ 4 4 Client, Url, 5 5 header::{HeaderMap, HeaderName, HeaderValue},