v0.13-dockerP3
This commit is contained in:
@@ -808,6 +808,9 @@ println!("Updating book");
|
||||
|
||||
let mut cover = doc_sent.cover.clone();
|
||||
if !doc_sent.cover.is_none() {
|
||||
if doc_sent.cover.clone().unwrap().contains("vinodjam") {
|
||||
cover = Some(doc_sent.cover.clone().unwrap().split("/").last().unwrap().to_string());
|
||||
} else {
|
||||
let img_bytes = reqwest::get(cover.unwrap()).await.unwrap().bytes().await.unwrap();
|
||||
//.expect("Could not fetch image");
|
||||
//let img_bytes = img_resp.unwrap().bytes();
|
||||
@@ -817,6 +820,7 @@ if !doc_sent.cover.is_none() {
|
||||
image.save(format!("{}/{}",images_dir,img_id)).expect("Failed to save image");
|
||||
cover = Some(img_id.to_string());
|
||||
}
|
||||
}
|
||||
let book: book::Model = book::Model{
|
||||
open_library_key: doc_sent.open_library_key.to_owned(),
|
||||
title: (doc_sent.title.to_owned()),
|
||||
|
||||
Reference in New Issue
Block a user