mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-24 16:52:28 +02:00
webui
This commit is contained in:
@@ -5,7 +5,7 @@ use enum_iterator::Sequence;
|
||||
use crate::{check_input_credentials, create_tuliprox_error_result, handle_tuliprox_error_result_list, info_err};
|
||||
use crate::error::{TuliproxError, TuliproxErrorKind};
|
||||
use crate::model::{EpgConfigDto};
|
||||
use crate::utils::{default_as_true, get_base_url_from_str, get_credentials_from_url_str, get_trimmed_string, sanitize_sensitive_info};
|
||||
use crate::utils::{default_as_true, get_base_url_from_str, get_credentials_from_url_str, get_trimmed_string, sanitize_sensitive_info, trim_last_slash};
|
||||
use log::debug;
|
||||
|
||||
|
||||
@@ -209,7 +209,10 @@ impl ConfigInputDto {
|
||||
} else {
|
||||
let base_url = get_base_url_from_str(&self.url);
|
||||
if base_url.is_some() {
|
||||
let provider_epg_url = format!("{}/xmltv.php?username={}&password={}", base_url.unwrap_or_default(), username.unwrap_or_default(), password.unwrap_or_default());
|
||||
let provider_epg_url = format!("{}/xmltv.php?username={}&password={}",
|
||||
trim_last_slash(&base_url.unwrap_or_default()),
|
||||
username.unwrap_or_default(),
|
||||
password.unwrap_or_default());
|
||||
Ok(provider_epg_url)
|
||||
} else {
|
||||
Err(format!("auto_epg is enabled for input {}, but url could not be parsed {}", self.name, sanitize_sensitive_info(&self.url)))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use std::fmt::Display;
|
||||
use crate::error::{TuliproxError, TuliproxErrorKind};
|
||||
use crate::foundation::filter::{apply_templates_to_pattern, apply_templates_to_pattern_single};
|
||||
use crate::model::{ItemField, PatternTemplate, TemplateValue};
|
||||
@@ -24,6 +25,16 @@ pub enum SortOrder {
|
||||
Desc,
|
||||
}
|
||||
|
||||
impl Display for SortOrder {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let str = match self {
|
||||
SortOrder::Asc => "asc".to_string(),
|
||||
SortOrder::Desc => "desc".to_string(),
|
||||
};
|
||||
write!(f, "{}", str)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct ConfigSortGroupDto {
|
||||
|
||||
Reference in New Issue
Block a user