mirror of
https://github.com/euzu/tuliprox.git
synced 2026-09-30 13:02:10 +02:00
some optimizations for field accessor
This commit is contained in:
@@ -8,9 +8,9 @@ fn create_affix_processor(affix: &InputAffix, is_prefix: bool) -> AffixProcessor
|
||||
Box::new(move |channel: &mut PlaylistItem| {
|
||||
let header = &mut channel.header;
|
||||
let value = header.get_field(affix.field.as_str()).map_or_else(|| String::from(&affix.value), |field_value| if is_prefix {
|
||||
format!("{}{}", &affix.value, field_value.as_str())
|
||||
format!("{}{field_value}", &affix.value, )
|
||||
} else {
|
||||
format!("{}{}", field_value.as_str(), &affix.value)
|
||||
format!("{field_value}{}", , &affix.value)
|
||||
});
|
||||
debug_if_enabled!("Applying input {}: {}={}", if is_prefix {"prefix"} else {"suffix"}, &affix.field, &value);
|
||||
header.set_field(&affix.field, value.as_str());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
pub mod playlist;
|
||||
mod xtream;
|
||||
mod affix;
|
||||
// mod affix;
|
||||
mod xtream_vod;
|
||||
mod xtream_series;
|
||||
pub mod epg;
|
||||
|
||||
@@ -16,7 +16,6 @@ use crate::model::{CounterModifier, Mapping};
|
||||
use crate::model::{FetchedPlaylist, FieldGetAccessor, FieldSetAccessor, PlaylistEntry, PlaylistGroup, PlaylistItem, UUIDType, XtreamCluster};
|
||||
use crate::model::{InputStats, PlaylistStats, SourceStats, TargetStats};
|
||||
use crate::processing::playlist_watch::process_group_watch;
|
||||
use crate::processing::processor::affix::apply_affixes;
|
||||
use crate::processing::processor::xtream_series::playlist_resolve_series;
|
||||
use crate::processing::processor::xtream_vod::playlist_resolve_vod;
|
||||
use crate::repository::playlist_repository::persist_playlist;
|
||||
@@ -462,9 +461,6 @@ async fn process_playlist_for_target(client: Arc<reqwest::Client>,
|
||||
processed_fetched_playlists.push(processed_fpl);
|
||||
}
|
||||
|
||||
step.tick("Processed affixes");
|
||||
apply_affixes(&mut processed_fetched_playlists);
|
||||
|
||||
step.tick("Processed epg");
|
||||
let (new_epg, new_playlist) = process_epg(&mut processed_fetched_playlists);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user