diff --git a/.example.env b/.example.env index c747a45a..33cfebf6 100644 --- a/.example.env +++ b/.example.env @@ -1,6 +1,6 @@ FRC_API_KEY="" MY_TEAM=766 HOSTNAME=localhost -TEAMS=766 -EVENTS=CAFR,CABE -SEASONS=2023,2024 \ No newline at end of file +TEAMS=766,199,840,841,2288,2367,2489,4141,4904,4973,6711,7245,8404,9143 +EVENTS=CASJ,CASF,CADA,CAFR,IDBO,CABE +SEASONS=2024 \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 9a66809d..185e91a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bear_tracks" -version = "5.1.3" +version = "5.2.0" edition = "2021" authors = ["Jayen Agrawal"] description = "a scouting app for frc" diff --git a/src/analyze.rs b/src/analyze.rs index 081f9c52..d7d28e30 100644 --- a/src/analyze.rs +++ b/src/analyze.rs @@ -298,7 +298,14 @@ fn season_2024(data: &web::Json) -> Result = vec![score, fast_intake, fast_travel, fast_shoot, fast_cycle, analysis_results[0]]; + let mps_scores: Vec = vec![ + score, + fast_intake, + fast_travel, + fast_shoot, + fast_cycle, + analysis_results[0] + ]; let analysis: Vec = vec![ real_bool_to_num(trap_note) as i64, diff --git a/src/main.rs b/src/main.rs index 7c4e4eef..c5fc77ad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -283,6 +283,12 @@ async fn data_get_main_teams(path: web::Path, db: web::Data) .json(db_main::execute(&db.main, db_main::MainData::GetTeams, path).await?)) } +async fn data_get_scouted_teams(req: HttpRequest, db: web::Data) -> Result { + Ok(HttpResponse::Ok() + .insert_header(("Cache-Control", "no-cache")) + .json(db_main::get_team_numbers(&db.main, req.match_info().get("season").unwrap().parse().unwrap()).await?)) +} + // get POSTed data from form async fn data_post_submit(data: web::Json, db: web::Data, user: db_auth::User) -> Result { Ok(HttpResponse::Ok() @@ -870,6 +876,10 @@ async fn main() -> io::Result<()> { .service( web::resource("/api/v1/data/teams/{args}*") .route(web::get().to(data_get_main_teams)), + ) + .service( + web::resource("/api/v1/data/scouted_teams/{season}") + .route(web::get().to(data_get_scouted_teams)), ) // season/event .service( web::resource("/api/v1/events/teams/{season}/{event}")