mirror of
https://github.com/euzu/tuliprox.git
synced 2026-09-29 12:32:08 +02:00
Mapper script built-in function template
This commit is contained in:
@@ -126,13 +126,14 @@ fn map_channel(mut channel: PlaylistItem, mapping: &Mapping) -> PlaylistItem {
|
||||
let channel_name = if mapping.match_as_ascii { deunicode(&header.name) } else { header.name.to_string() };
|
||||
if mapping.match_as_ascii && log_enabled!(Level::Trace) { trace!("Decoded {} for matching to {}", &header.name, &channel_name); }
|
||||
let ref_chan = &mut channel;
|
||||
let templates = mapping.templates.as_ref();
|
||||
for m in mapper {
|
||||
if let Some(script) = m.t_script.as_ref() {
|
||||
let provider = ValueProvider { pli: &ref_chan.clone() };
|
||||
let mut accessor = ValueAccessor { pli: ref_chan };
|
||||
if let Some(filter) = &m.t_filter {
|
||||
if filter.filter(&provider) {
|
||||
script.eval(&mut accessor);
|
||||
script.eval(&mut accessor, templates);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user