On complète la gestion du cache pour les métadonnées

This commit is contained in:
2025-10-26 13:05:46 +01:00
parent ff1ef01caa
commit 2ffeff8736
7 changed files with 83 additions and 23 deletions

View File

@@ -118,13 +118,13 @@ pub async fn generate_variant(
size: usize,
) -> Result<Vec<u8>> {
// Utiliser file_path_with_qualifier pour obtenir le chemin
let variant_path = cache.file_path_with_qualifier(pk, &size.to_string());
let variant_path = cache.get_file_path_with_qualifier(pk, &size.to_string());
if variant_path.exists() {
return Ok(tokio::fs::read(variant_path).await?);
}
let orig_path = cache.file_path_with_qualifier(pk, "orig");
let orig_path = cache.get_file_path_with_qualifier(pk, "orig");
// Charger l'image de manière synchrone (image::open n'est pas async)
let img = tokio::task::spawn_blocking(move || image::open(orig_path)).await??;