correction for lazy playlist and lazy cache

This commit is contained in:
2025-12-15 11:18:58 +01:00
parent 4bc80dfd08
commit 90399b408a
28 changed files with 349 additions and 39126 deletions

View File

@@ -117,8 +117,8 @@ fn derive_key() -> Result<[u8; 32]> {
/// ```
pub fn encrypt_password(password: &str) -> Result<String> {
let key = derive_key()?;
let cipher = Aes256Gcm::new_from_slice(&key)
.map_err(|e| anyhow!("Failed to create cipher: {}", e))?;
let cipher =
Aes256Gcm::new_from_slice(&key).map_err(|e| anyhow!("Failed to create cipher: {}", e))?;
// Nonce de 96 bits (12 bytes) - dérivé du mot de passe pour avoir
// un chiffrement déterministe (même password = même ciphertext)
@@ -173,8 +173,8 @@ pub fn decrypt_password(encrypted: &str) -> Result<String> {
.ok_or_else(|| anyhow!("Invalid encrypted password format (missing prefix)"))?;
let key = derive_key()?;
let cipher = Aes256Gcm::new_from_slice(&key)
.map_err(|e| anyhow!("Failed to create cipher: {}", e))?;
let cipher =
Aes256Gcm::new_from_slice(&key).map_err(|e| anyhow!("Failed to create cipher: {}", e))?;
let ciphertext = base64::engine::general_purpose::STANDARD
.decode(base64_data)