Log if missing positions
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
nyyu 2021-03-14 12:33:04 +01:00
parent 01ca3abeb9
commit a723ec1609

View file

@ -105,9 +105,13 @@ fn main() {
if !champion.data.contains_key(&champ_id) { if !champion.data.contains_key(&champ_id) {
champ_id = get_champ_from_key(&champion, &champ_id); champ_id = get_champ_from_key(&champion, &champ_id);
} }
if champion.data.contains_key(&champ_id) { if champion.data.contains_key(&champ_id) {
let path = lol_champs_dir.join(&champ_id).join("Recommended"); let path = lol_champs_dir.join(&champ_id).join("Recommended");
fs::create_dir_all(&path).unwrap(); fs::create_dir_all(&path).unwrap();
if positions.is_empty() {
error!("{} missing positions", &champ_id);
}
for pos in positions { for pos in positions {
data_source.write_item_set( data_source.write_item_set(
&champion.data.get(&champ_id).unwrap(), &champion.data.get(&champ_id).unwrap(),
@ -119,7 +123,7 @@ fn main() {
thread::sleep(Duration::from_millis(data_source.get_timeout())); thread::sleep(Duration::from_millis(data_source.get_timeout()));
} }
} else { } else {
error!("{} not found in LoL champs", &id); error!("{} not found in LoL champs", &champ_id);
} }
} }
} }