diff --git a/engine/src/utils/advanced_config.rs b/engine/src/utils/advanced_config.rs index 9301486f..a22b91f3 100644 --- a/engine/src/utils/advanced_config.rs +++ b/engine/src/utils/advanced_config.rs @@ -5,11 +5,13 @@ use serde_with::{serde_as, NoneAsEmptyString}; use shlex::split; use sqlx::{Pool, Sqlite}; use tokio::io::AsyncReadExt; +use ts_rs::TS; use crate::db::{handles, models::AdvancedConfiguration}; use crate::utils::ServiceError; -#[derive(Debug, Default, Serialize, Deserialize, Clone)] +#[derive(Debug, Default, Serialize, Deserialize, Clone, TS)] +#[ts(export, export_to = "advanced_config.d.ts")] pub struct AdvancedConfig { pub decoder: DecoderConfig, pub encoder: EncoderConfig, @@ -18,81 +20,115 @@ pub struct AdvancedConfig { } #[serde_as] -#[derive(Debug, Default, Serialize, Deserialize, Clone)] +#[derive(Debug, Default, Serialize, Deserialize, Clone, TS)] +#[ts(export, export_to = "advanced_config.d.ts")] pub struct DecoderConfig { + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub input_param: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub output_param: Option, + #[ts(skip)] #[serde(skip_serializing, skip_deserializing)] pub input_cmd: Option>, + #[ts(skip)] #[serde(skip_serializing, skip_deserializing)] pub output_cmd: Option>, } #[serde_as] -#[derive(Debug, Default, Serialize, Deserialize, Clone)] +#[derive(Debug, Default, Serialize, Deserialize, Clone, TS)] +#[ts(export, export_to = "advanced_config.d.ts")] pub struct EncoderConfig { + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub input_param: Option, + #[ts(skip)] #[serde(skip_serializing, skip_deserializing)] pub input_cmd: Option>, } #[serde_as] -#[derive(Debug, Default, Serialize, Deserialize, Clone)] +#[derive(Debug, Default, Serialize, Deserialize, Clone, TS)] +#[ts(export, export_to = "advanced_config.d.ts")] pub struct IngestConfig { + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub input_param: Option, + #[ts(skip)] #[serde(skip_serializing, skip_deserializing)] pub input_cmd: Option>, } #[serde_as] -#[derive(Debug, Default, Serialize, Deserialize, Clone)] +#[derive(Debug, Default, Serialize, Deserialize, Clone, TS)] +#[ts(export, export_to = "advanced_config.d.ts")] pub struct FilterConfig { + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub deinterlace: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub pad_scale_w: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub pad_scale_h: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub pad_video: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub fps: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub scale: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub set_dar: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub fade_in: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub fade_out: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub overlay_logo_scale: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub overlay_logo_fade_in: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub overlay_logo_fade_out: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub overlay_logo: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub tpad: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub drawtext_from_file: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub drawtext_from_zmq: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub aevalsrc: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub afade_in: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub afade_out: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub apad: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub volume: Option, + #[ts(type = "string")] #[serde_as(as = "NoneAsEmptyString")] pub split: Option, } diff --git a/engine/src/utils/config.rs b/engine/src/utils/config.rs index 0dc57df3..1d248389 100644 --- a/engine/src/utils/config.rs +++ b/engine/src/utils/config.rs @@ -454,8 +454,7 @@ pub struct Storage { pub filler_path: PathBuf, pub extensions: Vec, pub shuffle: bool, - #[ts(skip)] - #[serde(skip_serializing, skip_deserializing)] + #[serde(skip_deserializing)] pub shared_storage: bool, } @@ -490,7 +489,6 @@ pub struct Text { #[ts(skip)] #[serde(skip_serializing, skip_deserializing)] pub zmq_server_socket: Option, - #[ts(rename = "font")] #[serde(alias = "fontfile")] pub font: String, #[ts(skip)] diff --git a/frontend/components/ConfigAdvanced.vue b/frontend/components/ConfigAdvanced.vue index 9f497575..d0d483ff 100644 --- a/frontend/components/ConfigAdvanced.vue +++ b/frontend/components/ConfigAdvanced.vue @@ -1,5 +1,5 @@