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

@@ -9,9 +9,9 @@ fn main() {
creator: Some("Test Artist".to_string()),
class: "object.item.audioItem.musicTrack".to_string(),
artist: Some("Test Artist".to_string()),
album: None, // Pas d'album
album: None, // Pas d'album
genre: None,
album_art: None, // Pas d'albumArtURI
album_art: None, // Pas d'albumArtURI
album_art_pk: None,
date: None,
original_track_number: None,
@@ -42,7 +42,10 @@ fn main() {
println!("=== Output from quick_xml::se::to_string() ===");
println!("{}", xml);
println!("\n=== Length: {} bytes ===", xml.len());
println!("\n=== Starts with '<?xml' ? {} ===", xml.starts_with("<?xml"));
println!(
"\n=== Starts with '<?xml' ? {} ===",
xml.starts_with("<?xml")
);
println!("\n=== With manual XML declaration ===");
let with_decl = format!("<?xml version=\"1.0\" encoding=\"UTF-8\"?>{}", xml);
println!("{}", with_decl);

View File

@@ -554,7 +554,8 @@ impl ToXmlElement for Container {
fn to_xml_element(&self) -> Element {
let mut elem = Element::new("container");
elem.attributes.insert("id".into(), self.id.clone());
elem.attributes.insert("parentID".into(), self.parent_id.clone());
elem.attributes
.insert("parentID".into(), self.parent_id.clone());
if let Some(ref r) = self.restricted {
elem.attributes.insert("restricted".into(), r.clone());
}
@@ -562,11 +563,14 @@ impl ToXmlElement for Container {
elem.attributes.insert("childCount".into(), cc.clone());
}
if let Some(ref searchable) = self.searchable {
elem.attributes.insert("searchable".into(), searchable.clone());
elem.attributes
.insert("searchable".into(), searchable.clone());
}
elem.children.push(XMLNode::Element(text_element("dc:title", &self.title)));
elem.children.push(XMLNode::Element(text_element("upnp:class", &self.class)));
elem.children
.push(XMLNode::Element(text_element("dc:title", &self.title)));
elem.children
.push(XMLNode::Element(text_element("upnp:class", &self.class)));
for c in &self.containers {
elem.children.push(XMLNode::Element(c.to_xml_element()));
@@ -583,15 +587,18 @@ impl ToXmlElement for Item {
fn to_xml_element(&self) -> Element {
let mut elem = Element::new("item");
elem.attributes.insert("id".into(), self.id.clone());
elem.attributes.insert("parentID".into(), self.parent_id.clone());
elem.attributes
.insert("parentID".into(), self.parent_id.clone());
if let Some(ref r) = self.restricted {
elem.attributes.insert("restricted".into(), r.clone());
}
elem.children.push(XMLNode::Element(text_element("dc:title", &self.title)));
elem.children
.push(XMLNode::Element(text_element("dc:title", &self.title)));
if let Some(ref c) = self.creator {
elem.children.push(XMLNode::Element(text_element("dc:creator", c)));
elem.children
.push(XMLNode::Element(text_element("dc:creator", c)));
}
elem.children
@@ -644,7 +651,8 @@ impl ToXmlElement for Resource {
elem.attributes.insert("bitsPerSample".into(), bps.clone());
}
if let Some(ref freq) = self.sample_frequency {
elem.attributes.insert("sampleFrequency".into(), freq.clone());
elem.attributes
.insert("sampleFrequency".into(), freq.clone());
}
if let Some(ref ch) = self.nr_audio_channels {
elem.attributes.insert("nrAudioChannels".into(), ch.clone());
@@ -678,7 +686,6 @@ impl ToXmlElement for Description {
}
}
// ============= Itérateurs personnalisés =============
struct AllContainersIter<'a> {