Fixed imgur album loading breaking the whole bot
+ clippy + fmt
This commit is contained in:
parent
170f2aca07
commit
14032692b4
@ -60,10 +60,16 @@ impl BotState {
|
|||||||
let mut albums: HashMap<String, Vec<Image>> = HashMap::new();
|
let mut albums: HashMap<String, Vec<Image>> = HashMap::new();
|
||||||
|
|
||||||
for album in db.filter(|_, _: &AlbumConfig| true)? {
|
for album in db.filter(|_, _: &AlbumConfig| true)? {
|
||||||
albums.insert(
|
let imgur_album = imgur::get_album_images(&cfg.imgur_client_id, &album.album_id).await;
|
||||||
album.name.clone(),
|
|
||||||
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 {
|
Ok(Self {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user