2023-09-23 03:01:36 -04:00
|
|
|
#![feature(iterator_try_collect)]
|
|
|
|
|
|
|
|
use std::io::{self, Write};
|
|
|
|
|
|
|
|
mod queries;
|
|
|
|
use queries::*;
|
2023-09-26 21:37:13 -04:00
|
|
|
mod state;
|
|
|
|
use state::*;
|
2023-09-23 03:01:36 -04:00
|
|
|
mod datasets;
|
|
|
|
use datasets::*;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut config_dir = dirs::config_dir().unwrap();
|
|
|
|
config_dir.push("ggelo");
|
|
|
|
|
2023-09-26 21:37:13 -04:00
|
|
|
let auth_token = get_auth_key(&config_dir).unwrap();
|
|
|
|
|
|
|
|
// let config = AppState {
|
|
|
|
// config_dir,
|
|
|
|
// auth_token,
|
|
|
|
// };
|
|
|
|
|
|
|
|
let path = dataset_path(&config_dir, "test").unwrap();
|
2023-09-23 03:01:36 -04:00
|
|
|
let connection = open_dataset(&path).unwrap();
|
|
|
|
|
|
|
|
let set_data = SetData {
|
|
|
|
teams: vec![
|
|
|
|
vec![PlayerData {
|
|
|
|
id: PlayerId(1),
|
|
|
|
name: Some("player1".to_owned()),
|
|
|
|
prefix: None,
|
|
|
|
}],
|
|
|
|
vec![PlayerData {
|
|
|
|
id: PlayerId(2),
|
|
|
|
name: Some("player2".to_owned()),
|
|
|
|
prefix: None,
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
winner: 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
update_from_set(&connection, set_data.clone()).unwrap();
|
|
|
|
println!("{:?}", get_ratings(&connection, &set_data.teams).unwrap());
|
|
|
|
}
|