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 33761f1cef
commit 1268c24faf
7 changed files with 83 additions and 23 deletions

View File

@@ -21,7 +21,7 @@ async fn main() -> anyhow::Result<()> {
let pk = cache::add_with_metadata_extraction(&cache, test_url, Some("test")).await?;
println!("\nPK: {}", pk);
let file_path = cache.file_path(&pk);
let file_path = cache.get_file_path(&pk);
println!("File path: {}", file_path.display());
// Vérifier le format

View File

@@ -33,7 +33,7 @@ async fn main() -> anyhow::Result<()> {
println!("✓ Fichier converti avec succès!");
println!(" Clé primaire: {}", pk);
let file_path = cache.file_path(&pk);
let file_path = cache.get_file_path(&pk);
println!(" Chemin: {}", file_path.display());
if let Ok(metadata) = std::fs::metadata(&file_path) {

View File

@@ -384,7 +384,7 @@ pub async fn add_with_metadata_extraction(
cache.wait_until_finished(&pk).await?;
// Lire le fichier FLAC pour extraire les métadonnées
let file_path = cache.file_path(&pk);
let file_path = cache.get_file_path(&pk);
let flac_bytes = tokio::fs::read(&file_path).await?;
// Extraire les métadonnées