feat: Added config option to filter for specific disk space paths to display in the UI (CLI is unaffected)

This commit is contained in:
2026-01-22 10:49:30 -07:00
parent 5f3123cd79
commit 3be7b09da8
12 changed files with 378 additions and 10 deletions
+21
View File
@@ -436,6 +436,8 @@ pub struct ServarrConfig {
serialize_with = "serialize_header_map"
)]
pub custom_headers: Option<HeaderMap>,
#[serde(default, deserialize_with = "deserialize_optional_env_var_string_vec")]
pub monitored_storage_paths: Option<Vec<String>>,
}
impl ServarrConfig {
@@ -482,6 +484,7 @@ impl Default for ServarrConfig {
api_token_file: None,
ssl_cert_path: None,
custom_headers: None,
monitored_storage_paths: None,
}
}
}
@@ -548,6 +551,24 @@ where
}
}
fn deserialize_optional_env_var_string_vec<'de, D>(
deserializer: D,
) -> Result<Option<Vec<String>>, D::Error>
where
D: serde::Deserializer<'de>,
{
let opt: Option<Vec<String>> = Option::deserialize(deserializer)?;
match opt {
Some(vec) => Ok(Some(
vec
.into_iter()
.map(|it| interpolate_env_vars(&it))
.collect(),
)),
None => Ok(None),
}
}
fn deserialize_u16_env_var<'de, D>(deserializer: D) -> Result<Option<u16>, D::Error>
where
D: serde::Deserializer<'de>,