v0.14-popupV2

This commit is contained in:
2022-12-02 22:35:15 +05:30
parent 33e63fda17
commit c7c2465a87
3 changed files with 32 additions and 25 deletions

View File

@@ -795,10 +795,11 @@ println!("Updating book");
dotenvy::dotenv().ok();
let images_dir = env::var("IMAGES_DIR").expect("IMAGES_DIR is not set in .env file");
let backend_url = env::var("BACKEND_URL").expect("BACKEND_URL is not set in .env file");
let mut cover = doc_sent.cover.clone();
if !doc_sent.cover.is_none() {
if doc_sent.cover.clone().unwrap().contains("vinodjam") {
if doc_sent.cover.clone().unwrap().contains(&backend_url) {
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();