Changement du mécanisme d'attention sur les channels Radio Paradise.

This commit is contained in:
2025-11-29 14:19:16 +01:00
parent cf3f0afde4
commit 0a03f72467
44 changed files with 564 additions and 231 deletions

View File

@@ -222,7 +222,12 @@ impl ReadHandle {
let resource = meta.to_didl_resource(url).await;
// Récupérer les métadonnées pour construire l'Item DIDL
let title = meta.get_title().await.ok().flatten().unwrap_or_else(|| "Unknown".to_string());
let title = meta
.get_title()
.await
.ok()
.flatten()
.unwrap_or_else(|| "Unknown".to_string());
let artist = meta.get_artist().await.ok().flatten();
let album = meta.get_album().await.ok().flatten();
let genre = meta.get_genre().await.ok().flatten();

View File

@@ -222,6 +222,16 @@ impl WriteHandle {
Ok(())
}
/// Vérifie si la playlist contient déjà un pk
pub async fn contains_pk(&self, cache_pk: &str) -> Result<bool> {
if !self.playlist.is_alive() {
return Err(crate::Error::PlaylistDeleted(self.playlist.id.clone()));
}
let core = self.playlist.core.read().await;
Ok(core.tracks.iter().any(|record| record.cache_pk == cache_pk))
}
/// Change le TTL par défaut
pub async fn set_default_ttl(&self, ttl: Option<Duration>) -> Result<()> {
if !self.playlist.is_alive() {