Added extension piece of code for handling the mavlink mocker

This commit is contained in:
2026-05-05 12:19:14 -03:00
parent a43aa60f45
commit a9f09b6ce6
10 changed files with 1098 additions and 96 deletions
+2 -15
View File
@@ -1,3 +1,4 @@
use super::video::video_detail_xml;
use chrono::{Duration, SecondsFormat, Utc};
use uuid::Uuid;
@@ -20,14 +21,6 @@ pub struct CursorOverTime {
}
impl CursorOverTime {
fn escape_xml_attribute(value: &str) -> String {
value
.replace('&', "&")
.replace('"', """)
.replace('<', "&lt;")
.replace('>', "&gt;")
}
pub fn convert_to_xml(&self) -> String {
let uuid = match &self.uuid {
Some(uuid) => uuid,
@@ -118,13 +111,7 @@ impl CursorOverTime {
if let Some(video_url) = &self.video_url {
if !video_url.trim().is_empty() {
xml.push_str(
format!(
"<__video url=\"{}\" />",
Self::escape_xml_attribute(video_url.trim())
)
.as_str(),
);
xml.push_str(&video_detail_xml(video_url, uuid, &self.contact_callsign));
}
}