mirror of
https://github.com/euzu/tuliprox.git
synced 2026-09-28 20:12:12 +02:00
user editor form
This commit is contained in:
@@ -38,7 +38,7 @@ fn get_value(stack: &mut String, it: &mut std::str::Chars) -> String {
|
||||
stack.push(c);
|
||||
}
|
||||
|
||||
let result = (*stack).to_string();
|
||||
let result = (*stack).clone();
|
||||
stack.clear();
|
||||
result
|
||||
}
|
||||
@@ -67,7 +67,7 @@ fn token_till(stack: &mut String, it: &mut std::str::Chars, stop_char: char, sta
|
||||
if stack.is_empty() {
|
||||
None
|
||||
} else {
|
||||
let result = (*stack).to_string();
|
||||
let result = (*stack).clone();
|
||||
stack.clear();
|
||||
Some(result)
|
||||
}
|
||||
@@ -161,7 +161,7 @@ fn process_header(input_name: &str, video_suffixes: &[&str], content: &str, url:
|
||||
plih.id = chanid;
|
||||
}
|
||||
} else {
|
||||
plih.epg_channel_id = Some(plih.id.to_string());
|
||||
plih.epg_channel_id = Some(plih.id.clone());
|
||||
if let Some(pid) = provider_id {
|
||||
plih.id = pid;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ where
|
||||
if let Some((cluster, group_title)) = channel.map(|pli|
|
||||
(pli.header.xtream_cluster, &pli.header.group)) {
|
||||
grp_id += 1;
|
||||
Some(PlaylistGroup { id: grp_id, xtream_cluster: cluster, title: group_title.to_string(), channels })
|
||||
Some(PlaylistGroup { id: grp_id, xtream_cluster: cluster, title: group_title.clone(), channels })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ impl TVGuide {
|
||||
EPG_TAG_ICON => {
|
||||
if let Some(src) = child.get_attribute_value("src") {
|
||||
if !src.is_empty() {
|
||||
tag.icon = XmlTagIcon::Src(src.to_string());
|
||||
tag.icon = XmlTagIcon::Src(src.clone());
|
||||
child.icon = XmlTagIcon::Exists;
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ impl TVGuide {
|
||||
let score = min(100, (jw * 100.0).round() as u16);
|
||||
score >= best_match_threshold
|
||||
}) {
|
||||
return (true, Some(good_enough.to_string()));
|
||||
return (true, Some(good_enough.clone()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -436,7 +436,7 @@ fn collect_tag_attributes(e: &BytesStart, is_channel: bool, is_program: bool) ->
|
||||
if value.is_empty() {
|
||||
None
|
||||
} else if (is_channel && key == EPG_ATTRIB_ID) || (is_program && key == EPG_ATTRIB_CHANNEL) {
|
||||
Some((key, value.to_lowercase().to_string()))
|
||||
Some((key, value.to_lowercase().clone()))
|
||||
} else {
|
||||
Some((key, value.to_string()))
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ pub fn parse_xtream_series_info(info: &Value, group_title: &str, series_name: &s
|
||||
(episode.clone(),
|
||||
PlaylistItem {
|
||||
header: PlaylistItemHeader {
|
||||
id: episode.id.to_string(),
|
||||
id: episode.id.clone(),
|
||||
uuid: generate_playlist_uuid(&input.name, &episode.id, PlaylistItemType::Series, &episode_url),
|
||||
name: series_name.to_string(),
|
||||
logo: episode.info.as_ref().map_or_else(String::new, |info| info.movie_image.to_string()),
|
||||
logo: episode.info.as_ref().map_or_else(String::new, |info| info.movie_image.clone()),
|
||||
group: group_title.to_string(),
|
||||
title: episode.title.clone(),
|
||||
url: episode_url.to_string(),
|
||||
@@ -60,7 +60,7 @@ pub fn parse_xtream_series_info(info: &Value, group_title: &str, series_name: &s
|
||||
xtream_cluster: XtreamCluster::Series,
|
||||
additional_properties: episode.get_additional_properties(&series_info),
|
||||
category_id: 0,
|
||||
input_name: input.name.to_string(),
|
||||
input_name: input.name.clone(),
|
||||
..Default::default()
|
||||
}
|
||||
})
|
||||
@@ -104,7 +104,7 @@ pub fn create_xtream_url(xtream_cluster: XtreamCluster, url: &str, username: &st
|
||||
stream.container_extension.as_ref().map(std::string::ToString::to_string).as_ref(),
|
||||
live_stream_use_prefix, live_stream_without_extension)
|
||||
} else {
|
||||
stream.direct_source.to_string()
|
||||
stream.direct_source.clone()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ pub fn parse_xtream(input: &ConfigInput,
|
||||
streams: &Value) -> Result<Option<Vec<PlaylistGroup>>, TuliproxError> {
|
||||
match map_to_xtream_category(categories) {
|
||||
Ok(xtream_categories) => {
|
||||
let input_name = Arc::new(input.name.to_string());
|
||||
let input_name = Arc::new(input.name.clone());
|
||||
let url = input.url.as_str();
|
||||
let username = input.username.as_ref().map_or("", |v| v);
|
||||
let password = input.password.as_ref().map_or("", |v| v);
|
||||
@@ -123,7 +123,7 @@ pub fn parse_xtream(input: &ConfigInput,
|
||||
Ok(mut xtream_streams) => {
|
||||
let mut group_map: HashMap<String, XtreamCategory> =
|
||||
xtream_categories.into_iter().map(|category|
|
||||
(category.category_id.to_string(), category)
|
||||
(category.category_id.clone(), category)
|
||||
).collect();
|
||||
let mut unknown_grp = XtreamCategory {
|
||||
category_id: "0".to_string(),
|
||||
@@ -152,11 +152,11 @@ pub fn parse_xtream(input: &ConfigInput,
|
||||
header: PlaylistItemHeader {
|
||||
id: stream.get_stream_id().to_string(),
|
||||
uuid: generate_playlist_uuid(&input_name, &stream.get_stream_id().to_string(), item_type, &stream_url),
|
||||
name: stream.name.to_string(),
|
||||
logo: stream.stream_icon.to_string(),
|
||||
group: category_name.to_string(),
|
||||
title: stream.name.to_string(),
|
||||
url: stream_url.to_string(),
|
||||
name: stream.name.clone(),
|
||||
logo: stream.stream_icon.clone(),
|
||||
group: category_name.clone(),
|
||||
title: stream.name.clone(),
|
||||
url: stream_url.clone(),
|
||||
epg_channel_id: stream.epg_channel_id.clone(),
|
||||
item_type,
|
||||
xtream_cluster,
|
||||
@@ -178,7 +178,7 @@ pub fn parse_xtream(input: &ConfigInput,
|
||||
PlaylistGroup {
|
||||
id: category.category_id.parse::<u32>().unwrap_or(0),
|
||||
xtream_cluster,
|
||||
title: category.category_name.to_string(),
|
||||
title: category.category_name.clone(),
|
||||
channels: category.channels.clone(),
|
||||
}
|
||||
}).collect()))
|
||||
|
||||
Reference in New Issue
Block a user