Changement du mécanisme d'attention sur les channels Radio Paradise.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user