la crate des playlists

This commit is contained in:
2025-10-27 12:32:31 +01:00
parent a0e5d92bf9
commit 92c35116f8
23 changed files with 1943 additions and 837 deletions

38
pmoplaylist/src/error.rs Normal file
View File

@@ -0,0 +1,38 @@
//! Types d'erreurs pour pmoplaylist
/// Erreurs de gestion de playlist
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Playlist not found: {0}")]
PlaylistNotFound(String),
#[error("Playlist deleted: {0}")]
PlaylistDeleted(String),
#[error("Playlist already exists: {0}")]
PlaylistAlreadyExists(String),
#[error("Playlist is not persistent: {0}")]
PlaylistNotPersistent(String),
#[error("Write lock already held for playlist: {0}")]
WriteLockHeld(String),
#[error("Cache entry not found: {0}")]
CacheEntryNotFound(String),
#[error("Cache error: {0}")]
CacheError(String),
#[error("Persistence error: {0}")]
PersistenceError(String),
#[error("PlaylistManager not initialized")]
ManagerNotInitialized,
#[error(transparent)]
Other(#[from] anyhow::Error),
}
/// Type Result spécialisé pour pmoplaylist
pub type Result<T> = std::result::Result<T, Error>;