diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 0c0675e..4ecca16 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1584,7 +1584,6 @@ dependencies = [ "document-features", "image", "num-traits", - "rayon", "thiserror", ] @@ -5261,6 +5260,7 @@ dependencies = [ "image", "log", "midoku-bindings", + "rayon", "serde", "serde_json", "tar", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 182665d..106010c 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -22,11 +22,12 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2.0.2", features = [] } [dependencies] -fast_image_resize = { version = "5.0.0", features = ["image", "rayon"] } +fast_image_resize = { version = "5.0.0", features = ["image"] } flate2 = "1.0.34" image = "0.25.5" log = "0.4.22" midoku-bindings = { git = "https://github.com/midokuapp/midoku-rs.git" } +rayon = "1.10.0" serde_json = "1.0.132" serde = { version = "1.0.214", features = ["derive"] } tar = "0.4.43" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index f1c2742..0bd8cfb 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -138,7 +138,11 @@ async fn uninstall_extension( } #[tauri::command] -async fn download_image(url: String, min_size: Option) -> tauri::Result> { +async fn download_image( + pool: State<'_, rayon::ThreadPool>, + url: String, + min_size: Option, +) -> tauri::Result> { trace!( "download_image called with url: {} and min_size: {:?}", url, @@ -181,17 +185,23 @@ async fn download_image(url: String, min_size: Option) -> tauri::Result