mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-20 06:42:20 +02:00
feat: added support for panel api
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use crate::error::{TuliproxError, TuliproxErrorKind};
|
||||
use crate::model::{EpgConfigDto};
|
||||
use crate::utils::{default_as_true, get_credentials_from_url_str, get_trimmed_string, sanitize_sensitive_info, trim_last_slash, deserialize_timestamp};
|
||||
use super::PanelApiConfigDto;
|
||||
use crate::{check_input_credentials, check_input_connections, create_tuliprox_error_result, handle_tuliprox_error_result_list, info_err};
|
||||
use enum_iterator::Sequence;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
@@ -300,6 +301,8 @@ pub struct ConfigInputDto {
|
||||
pub staged: Option<StagedInputDto>,
|
||||
#[serde(default, deserialize_with = "deserialize_timestamp", skip_serializing_if = "Option::is_none")]
|
||||
pub exp_date: Option<i64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub panel_api: Option<PanelApiConfigDto>,
|
||||
}
|
||||
|
||||
impl Default for ConfigInputDto {
|
||||
@@ -322,6 +325,7 @@ impl Default for ConfigInputDto {
|
||||
method: InputFetchMethod::default(),
|
||||
staged: None,
|
||||
exp_date: None,
|
||||
panel_api: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ mod video_download;
|
||||
mod schedule;
|
||||
mod log;
|
||||
mod input;
|
||||
mod panel_api;
|
||||
mod stream;
|
||||
mod epg;
|
||||
mod reverse_proxy;
|
||||
@@ -53,6 +54,7 @@ pub use video_download::*;
|
||||
pub use schedule::*;
|
||||
pub use log::*;
|
||||
pub use input::*;
|
||||
pub use panel_api::*;
|
||||
pub use stream::*;
|
||||
pub use epg_smart_match::*;
|
||||
pub use epg::*;
|
||||
@@ -69,4 +71,4 @@ pub use app_config::*;
|
||||
pub use config_type::*;
|
||||
pub use playlist_update_state::*;
|
||||
pub use favourites::*;
|
||||
pub use crate::apply_batch_aliases;
|
||||
pub use crate::apply_batch_aliases;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Default, PartialEq)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PanelApiQueryParamDto {
|
||||
pub key: String,
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Default, PartialEq)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PanelApiQueryParametersDto {
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub panel_info: Vec<PanelApiQueryParamDto>,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub new_client: Vec<PanelApiQueryParamDto>,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub renew_client: Vec<PanelApiQueryParamDto>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Default, PartialEq)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PanelApiConfigDto {
|
||||
pub url: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub api_key: Option<String>,
|
||||
#[serde(default)]
|
||||
pub query_parameter: PanelApiQueryParametersDto,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user