debug de la playlist history de radio paradise

This commit is contained in:
2025-12-26 15:54:57 +01:00
parent bfb8f588b8
commit 0348397173
2 changed files with 13 additions and 28 deletions

View File

@@ -341,13 +341,6 @@ fn spawn_playlist_event_handler(manager: Arc<ParadiseChannelManager>) {
e
);
}
if let Err(e) = append_track_to_history(descriptor, &cache_pk).await {
tracing::warn!(
"Failed to update history for channel {}: {}",
descriptor.display_name,
e
);
}
}
}
}
@@ -361,22 +354,3 @@ fn channel_from_live_playlist(playlist_id: &str) -> Option<&'static ChannelDescr
.iter()
.find(|descriptor| descriptor.slug == slug)
}
async fn append_track_to_history(descriptor: &ChannelDescriptor, cache_pk: &str) -> Result<()> {
let playlist_id = format!("radio-paradise-history-{}", descriptor.slug);
let manager = pmoplaylist::PlaylistManager();
let handle = manager
.get_persistent_write_handle(playlist_id.clone())
.await
.with_context(|| format!("Failed to get history playlist {}", playlist_id))?;
if handle.contains_pk(cache_pk).await? {
return Ok(());
}
handle
.push(cache_pk.to_string())
.await
.with_context(|| format!("Failed to append {} to {}", cache_pk, playlist_id))?;
Ok(())
}