From a8d08370213a33bbf9d08a173b3eaca189598405 Mon Sep 17 00:00:00 2001 From: euzu Date: Sun, 4 Jan 2026 16:40:42 +0100 Subject: [PATCH] Fixed EPG titles to match renamed / mapped titles --- backend/src/model/xmltv.rs | 4 ++-- backend/src/processing/parser/xmltv.rs | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/backend/src/model/xmltv.rs b/backend/src/model/xmltv.rs index fa7ed2dee..cb1148865 100644 --- a/backend/src/model/xmltv.rs +++ b/backend/src/model/xmltv.rs @@ -67,7 +67,7 @@ impl XmlTag { pub struct Epg { pub priority: i16, pub logo_override: bool, - pub attributes: Option>, + pub attributes: Option, String>>, pub children: Vec>, } @@ -81,7 +81,7 @@ impl Epg { let mut elem = BytesStart::new("tv"); if let Some(attrs) = &self.attributes { for (k, v) in attrs { - elem.push_attribute((k.as_str(), v.as_str())); + elem.push_attribute((k.as_ref(), v.as_str())); } } writer.write_event_async(Event::Start(elem)).await?; diff --git a/backend/src/processing/parser/xmltv.rs b/backend/src/processing/parser/xmltv.rs index 45f28c1d7..f52767cc8 100644 --- a/backend/src/processing/parser/xmltv.rs +++ b/backend/src/processing/parser/xmltv.rs @@ -281,7 +281,7 @@ impl TVGuide { match CompressedFileReaderAsync::new(&epg_source.file_path).await { Ok(mut reader) => { let mut children: Vec> = vec![]; - let mut tv_attributes: Option> = None; + let mut tv_attributes: Option, String>> = None; let smart_match = id_cache.smart_match_config.enabled; let fuzzy_matching = smart_match && id_cache.smart_match_config.fuzzy_matching; let mut filter_tags = |mut tag: XmlTag| { @@ -315,9 +315,7 @@ impl TVGuide { } } EPG_TAG_TV => { - tv_attributes = tag.attributes.as_ref().map(|attrs| { - attrs.iter().map(|(k, v)| (k.to_string(), v.clone())).collect::>() - }); + tv_attributes.clone_from(&tag.attributes); } _ => {} } @@ -489,7 +487,7 @@ pub fn flatten_tvguide(tv_guides: &[Epg]) -> Option { None } else { let epg_children: Mutex>> = Mutex::new(Vec::new()); - let epg_attributes = tv_guides.first().and_then(|t| t.attributes.clone()); + let epg_attributes: Option, String>> = tv_guides.first().and_then(|t| t.attributes.clone()); let count = tv_guides.iter().map(|tvg| tvg.children.len()).sum(); let channel_mapping: DashMap = DashMap::with_capacity(count);