Various fixes

This commit is contained in:
Kiana Sheibani 2023-09-30 04:37:10 -04:00
parent 0f71cfa3c5
commit 9feba1a136
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
4 changed files with 74 additions and 84 deletions

View file

@ -119,6 +119,9 @@ fn sync(names: Vec<String>, all: bool, auth_token: Option<String>) {
let names = if all {
list_datasets(&connection).unwrap()
} else if names.len() == 0 {
new_dataset(&connection, "default").unwrap();
vec![String::from("default")]
} else {
names
};
@ -130,14 +133,16 @@ fn sync(names: Vec<String>, all: bool, auth_token: Option<String>) {
TournamentSetsVars {
last_query: Timestamp(last_sync),
game_id: VideogameId(1),
country: None,
state: None,
tournament: 1,
set_page: 1,
set_pagesize: 50,
event_limit: 9999999,
},
&auth,
)
.unwrap();
update_from_tournaments(&connection, &name, results).unwrap();
update_from_tournament(&connection, &name, results).unwrap();
let current_time = SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)