From bd0544820a35543a9841bd774225eb23e504c4d5 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Fri, 28 Nov 2025 20:06:53 +0100 Subject: [PATCH] On avance avec les : no compatible URI found. --- pmoparadise/src/source.rs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/pmoparadise/src/source.rs b/pmoparadise/src/source.rs index da67d9c9..c108f3fa 100644 --- a/pmoparadise/src/source.rs +++ b/pmoparadise/src/source.rs @@ -546,9 +546,32 @@ impl MusicSource for RadioParadiseSource { )) })?; + // Ajuster les IDs/parent_id/URL pour coller au schéma Radio Paradise, + // comme dans get_history_items. + let mut adjusted = Vec::new(); + for mut item in items { + if let Some(resource) = item.resources.first_mut() { + if let Some(pk2) = resource.url.split('/').last() { + item.id = + format!("radio-paradise:channel:{}:history:track:{}", slug, pk2); + item.parent_id = + format!("radio-paradise:channel:{}:history", slug); + + if resource.url.starts_with('/') { + resource.url = + format!("{}{}", self.base_url, resource.url); + } + } + } + if item.genre.is_none() { + item.genre = Some("Radio Paradise".to_string()); + } + adjusted.push(item); + } + // Find the item matching this pk in the item ID let expected_id = format!("radio-paradise:channel:{}:history:track:{}", slug, pk); - for item in items { + for item in adjusted { if item.id == expected_id { return Ok(item); }