mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-19 06:12:24 +02:00
Epg resource rewrite
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user