feat: Add logic_mut() to Node and fix playlist registration in FlacCacheSink
- Add Node::logic_mut() method to allow post-construction configuration of node logic before run() is called - Fix FlacCacheSink to properly transfer playlist_handle_pending to the inner logic using logic_mut() - Resolves FIXME at flac_cache_sink.rs:656 about missing logic_mut() This enables the playlist registration mechanism to work correctly: 1. User calls register_playlist() on FlacCacheSink 2. Handle is stored in playlist_handle_pending 3. During run(), handle is transferred to FlacCacheSinkLogic 4. Tracks are automatically added to playlist after caching
This commit is contained in:
@@ -482,6 +482,15 @@ impl<L: NodeLogic> Node<L> {
|
||||
pub fn logic(&self) -> &L {
|
||||
&self.logic
|
||||
}
|
||||
|
||||
/// Retourne une référence mutable vers la logique métier du nœud
|
||||
///
|
||||
/// Permet de configurer la logique après construction mais avant run().
|
||||
/// Utile pour définir des options qui ne peuvent pas être connues
|
||||
/// au moment de la construction du nœud.
|
||||
pub fn logic_mut(&mut self) -> &mut L {
|
||||
&mut self.logic
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
|
||||
Reference in New Issue
Block a user