|
|
|
@ -20,14 +20,27 @@ pub async fn view(arg_m: &ArgMatches<'_>) {
|
|
|
|
|
let handles = arg_m.values_of("id").unwrap().map(|id| {
|
|
|
|
|
let cloned_client = client.clone();
|
|
|
|
|
let id = id.to_string();
|
|
|
|
|
tokio::spawn(async move {
|
|
|
|
|
(utils::get_hentai(cloned_client, &id).await, id)
|
|
|
|
|
})
|
|
|
|
|
let cid = id.clone();
|
|
|
|
|
(tokio::spawn(async move {
|
|
|
|
|
utils::get_hentai(cloned_client, &cid).await
|
|
|
|
|
}), id)
|
|
|
|
|
}).collect::<Vec<_>>();
|
|
|
|
|
let mut fail = false;
|
|
|
|
|
let mut one_done = false;
|
|
|
|
|
for handle in handles {
|
|
|
|
|
let (hentai, id) = handle.await.unwrap();
|
|
|
|
|
let (handle, id) = handle;
|
|
|
|
|
let hentai = match handle.await {
|
|
|
|
|
Ok(hentai) => hentai,
|
|
|
|
|
Err(err) => {
|
|
|
|
|
if one_done {
|
|
|
|
|
eprintln!("");
|
|
|
|
|
}
|
|
|
|
|
eprintln!("ID: {}\nError: {}", id, err);
|
|
|
|
|
fail = true;
|
|
|
|
|
one_done = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
match hentai {
|
|
|
|
|
Ok(hentai) => {
|
|
|
|
|
match hentai {
|
|
|
|
|