Fixed imgur album loading breaking the whole bot

+ clippy + fmt
This commit is contained in:
Joey Hines 2023-05-26 18:32:47 -06:00
parent 170f2aca07
commit 14032692b4
Signed by: joeyahines
GPG Key ID: 995E531F7A569DDB

View File

@ -60,10 +60,16 @@ impl BotState {
let mut albums: HashMap<String, Vec<Image>> = HashMap::new();
for album in db.filter(|_, _: &AlbumConfig| true)? {
albums.insert(
album.name.clone(),
imgur::get_album_images(&cfg.imgur_client_id, &album.album_id).await?,
);
let imgur_album = imgur::get_album_images(&cfg.imgur_client_id, &album.album_id).await;
match imgur_album {
Ok(imgur) => {
albums.insert(album.name.clone(), imgur);
}
Err(err) => {
println!("Unable to parse album '{}'. Error: {}", album.name, err);
}
}
}
Ok(Self {