This commit is contained in:
sxyazi 2023-08-07 23:03:08 +08:00
parent 8927b4b162
commit f6c77a9175
No known key found for this signature in database

View file

@ -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()))
}
}