user editor form

This commit is contained in:
euzu
2025-08-26 23:34:04 +02:00
parent 1fca84e762
commit 30a88bb2ae
63 changed files with 791 additions and 398 deletions
+5 -5
View File
@@ -75,9 +75,9 @@ impl EpgIdCache<'_> {
let normalized = self.normalize(key);
let phonetic = self.phonetic(&normalized);
self.normalized.insert(normalized.to_string(), None);
self.normalized.insert(normalized.clone(), None);
self.phonetics
.entry(phonetic.to_string())
.entry(phonetic.clone())
.or_default()
.insert(normalized);
}
@@ -196,13 +196,13 @@ fn assign_channel_epg(new_epg: &mut Vec<Epg>, fp: &mut FetchedPlaylist, id_cache
(epg_source.logo_override || chan.header.logo.is_empty() || chan.header.logo_small.is_empty()) {
if let Some(icon_tag) = icon_tags.get(epg_channel_id) {
if let XmlTagIcon::Src(icon) = &icon_tag.icon {
icon_assigned.insert(epg_channel_id.to_string());
icon_assigned.insert(epg_channel_id.clone());
if epg_source.logo_override || chan.header.logo.is_empty() {
trace!("Matched channel {} to epg icon {icon}", chan.header.name);
chan.header.logo = (*icon).to_string();
chan.header.logo = (*icon).clone();
}
if epg_source.logo_override || chan.header.logo_small.is_empty() {
chan.header.logo_small = (*icon).to_string();
chan.header.logo_small = (*icon).clone();
}
}
}
+4 -4
View File
@@ -128,7 +128,7 @@ fn map_channel(mut channel: PlaylistItem, mapping: &Mapping) -> PlaylistItem {
if let Some(mapper) = &mapping.mapper {
if !mapper.is_empty() {
let header = &channel.header;
let channel_name = if mapping.match_as_ascii { deunicode(&header.name) } else { header.name.to_string() };
let channel_name = if mapping.match_as_ascii { deunicode(&header.name) } else { header.name.clone() };
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();
@@ -172,7 +172,7 @@ fn map_playlist(playlist: &mut [PlaylistGroup], target: &ConfigTarget) -> Option
grp_id += 1;
new_groups.push(PlaylistGroup {
id: grp_id,
title: title.to_string(),
title: title.clone(),
channels: vec![channel.clone()],
xtream_cluster: *cluster,
});
@@ -287,7 +287,7 @@ async fn process_source(client: Arc<reqwest::Client>, cfg: Arc<AppConfig>, sourc
);
}
let elapsed = start_time.elapsed().as_secs();
input_stats.insert(input_name.to_string(), create_input_stat(group_count, channel_count, error_list.len(),
input_stats.insert(input_name.clone(), create_input_stat(group_count, channel_count, error_list.len(),
input.input_type, input_name, elapsed));
}
}
@@ -443,7 +443,7 @@ fn flatten_groups(playlistgroups: Vec<PlaylistGroup>) -> Vec<PlaylistGroup> {
let mut idx: usize = 0;
let mut group_map: HashMap<(String, XtreamCluster), usize> = HashMap::new();
for group in playlistgroups {
let key = (group.title.to_string(), group.xtream_cluster);
let key = (group.title.clone(), group.xtream_cluster);
match group_map.entry(key) {
std::collections::hash_map::Entry::Vacant(v) => {
v.insert(idx);
+3 -3
View File
@@ -95,8 +95,8 @@ fn playlist_comparator(
}
fn playlistgroup_comparator(a: &PlaylistGroup, b: &PlaylistGroup, group_sort: &ConfigSortGroup, match_as_ascii: bool) -> Ordering {
let value_a = if match_as_ascii { deunicode(&a.title) } else { a.title.to_string() };
let value_b = if match_as_ascii { deunicode(&b.title) } else { b.title.to_string() };
let value_a = if match_as_ascii { deunicode(&a.title) } else { a.title.clone() };
let value_b = if match_as_ascii { deunicode(&b.title) } else { b.title.clone() };
playlist_comparator(group_sort.sequence.as_ref(), group_sort.order, &value_a, &value_b)
}
@@ -125,7 +125,7 @@ pub(in crate::processing::processor) fn sort_playlist(target: &ConfigTarget, new
for channel_sort in channel_sorts {
let regexp = &channel_sort.group_pattern;
for group in new_playlist.iter_mut() {
let group_title = if match_as_ascii { deunicode(&group.title) } else { group.title.to_string() };
let group_title = if match_as_ascii { deunicode(&group.title) } else { group.title.clone() };
if regexp.is_match(group_title.as_str()) {
group.channels.sort_by(|chan1, chan2| playlistitem_comparator(chan1, chan2, channel_sort, match_as_ascii));
}