Epg resource rewrite

This commit is contained in:
euzu
2025-11-21 12:28:56 +01:00
parent 21807dd95b
commit dd4f3beb56
8 changed files with 162 additions and 59 deletions
+7 -6
View File
@@ -226,6 +226,13 @@ fn concat_text(t1: &String, t2: &str) -> String {
}
}
pub fn get_attr_value(attr: &quick_xml::events::attributes::Attribute) -> Option<String> {
if let Ok(value) = attr.unescape_value() {
return Some(value.to_string());
}
None
}
#[allow(clippy::too_many_lines)]
async fn parse_xmltv_for_web_ui<R: AsyncRead + Send + Unpin>(reader: R) -> Result<EpgTv, TuliproxError> {
@@ -246,12 +253,6 @@ async fn parse_xmltv_for_web_ui<R: AsyncRead + Send + Unpin>(reader: R) -> Resul
- chrono::Duration::days(1);
let threshold_ts = yesterday_start.timestamp();
let get_attr_value = |attr: &quick_xml::events::attributes::Attribute| {
if let Ok(value) = attr.unescape_value() {
return Some(value.to_string());
}
None
};
loop {
match reader.read_event_into_async(&mut buf).await {