diff --git a/adaptor/src/image.rs b/adaptor/src/image.rs index d9a66a31..1647a342 100644 --- a/adaptor/src/image.rs +++ b/adaptor/src/image.rs @@ -1,7 +1,7 @@ -use std::{env, path::{Path, PathBuf}, sync::Arc}; +use std::{path::{Path, PathBuf}, sync::Arc}; use anyhow::Result; -use config::PREVIEW; +use config::{MANAGER, PREVIEW}; use image::{imageops::FilterType, DynamicImage, ImageFormat}; use md5::{Digest, Md5}; use shared::tty_ratio; @@ -57,8 +57,8 @@ impl Image { #[inline] pub fn cache(path: &Path) -> PathBuf { - env::temp_dir() - .join("yazi") + MANAGER + .cache .join(format!("{:x}", Md5::new_with_prefix(path.to_string_lossy().as_bytes()).finalize())) } }