Amélioration des pmoplaylist

This commit is contained in:
2025-12-17 08:31:47 +01:00
parent d6920703a1
commit ca36a102e5
11 changed files with 201 additions and 33 deletions

View File

@@ -34,7 +34,7 @@ use pmoaudiocache::{
};
use pmocovers::{new_cache_with_consolidation as new_cover_cache, register_cover_cache};
use pmoparadise::{RadioParadiseClient, RadioParadiseStreamSource};
use pmoplaylist::register_audio_cache as register_playlist_audio_cache;
use pmoplaylist::{register_audio_cache as register_playlist_audio_cache, PlaylistRole};
use std::env;
use std::sync::Arc;
use tokio_util::sync::CancellationToken;
@@ -137,6 +137,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
writer
.set_title(format!("Radio Paradise - Channel {}", channel_id))
.await?;
writer.set_role(PlaylistRole::Radio).await?;
writer.flush().await?; // Vider la playlist si elle existait
tracing::debug!("Playlist created and flushed");

View File

@@ -6,7 +6,7 @@ use crate::{client::RadioParadiseClient, models::EventId};
use anyhow::Result;
use pmoaudiocache::Cache as AudioCache;
use pmocovers::Cache as CoversCache;
use pmoplaylist::{PlaylistManager, ReadHandle, WriteHandle};
use pmoplaylist::{PlaylistManager, PlaylistRole, ReadHandle, WriteHandle};
use std::{
collections::{HashMap, VecDeque},
sync::Arc,
@@ -115,7 +115,7 @@ impl RadioParadisePlaylistFeeder {
) -> Result<(Self, ReadHandle)> {
let manager = PlaylistManager::get();
let write_handle = manager
.create_persistent_playlist(playlist_id.clone())
.create_persistent_playlist_with_role(playlist_id.clone(), PlaylistRole::Radio)
.await?;
let read_handle = manager.get_read_handle(&playlist_id).await?;