mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-02 14:02:22 +02:00
epg id is now case insensitive
This commit is contained in:
@@ -128,7 +128,8 @@ fn process_header(input: &ConfigInput, video_suffixes: &[&str], content: &str, u
|
||||
}
|
||||
}
|
||||
// plih.virtual_id = plih.id;
|
||||
plih.epg_channel_id = Some(plih.id.to_string());
|
||||
plih.epg_channel_id = Some(plih.id.to_lowercase().to_string());
|
||||
|
||||
}
|
||||
|
||||
if video_suffixes.iter().any(|suffix| url.ends_with(suffix)) {
|
||||
|
||||
@@ -60,12 +60,20 @@ where
|
||||
match reader.read_event_into(&mut buf) {
|
||||
Ok(Event::Eof) => break,
|
||||
Ok(Event::Start(e)) => {
|
||||
let name = String::from_utf8_lossy(e.name().as_ref()).to_string();
|
||||
let is_tv_tag = name == EPG_TAG_TV;
|
||||
let name = String::from_utf8_lossy(e.name().as_ref()).as_ref().to_owned();
|
||||
let (is_tv_tag, is_channel, is_program) = match name.as_str() {
|
||||
EPG_TAG_TV => (true, false, false),
|
||||
EPG_TAG_CHANNEL => (false, true, false),
|
||||
EPG_TAG_PROGRAMME => (false, false, true),
|
||||
_ => (false, false, false)
|
||||
};
|
||||
let attributes = e.attributes().filter_map(Result::ok)
|
||||
.filter_map(|a| {
|
||||
let key = String::from_utf8_lossy(a.key.as_ref()).to_string();
|
||||
let value = String::from(a.unescape_value().unwrap().as_ref());
|
||||
let mut value = String::from(a.unescape_value().unwrap().as_ref());
|
||||
if (is_channel && key == EPG_ATTRIB_ID) || (is_program && key == EPG_ATTRIB_CHANNEL) {
|
||||
value = value.to_lowercase().to_string();
|
||||
}
|
||||
if value.is_empty() {
|
||||
None
|
||||
} else {
|
||||
|
||||
@@ -148,7 +148,7 @@ pub fn parse_xtream(input: &ConfigInput,
|
||||
group: category_name.to_string(),
|
||||
title: stream.name.to_string(),
|
||||
url: stream_url.to_string(),
|
||||
epg_channel_id: stream.epg_channel_id.clone(),
|
||||
epg_channel_id: stream.epg_channel_id.as_ref().map(|id| id.to_lowercase().to_string()),
|
||||
item_type,
|
||||
xtream_cluster,
|
||||
additional_properties: stream.get_additional_properties(),
|
||||
|
||||
Reference in New Issue
Block a user