strip path prefix

This commit is contained in:
jb-alvarado 2024-06-14 16:03:44 +02:00
parent e2325dba7f
commit af5cc0b55c

View File

@ -695,7 +695,13 @@ impl PlayoutConfig {
}
pub async fn dump(pool: &Pool<Sqlite>, id: i32) -> Result<(), ServiceError> {
let config = Self::new(pool, id).await;
let mut config = Self::new(pool, id).await;
config.storage.filler = config
.storage
.filler
.strip_prefix(config.global.storage_path.clone())
.unwrap_or(&config.storage.filler)
.to_owned();
let toml_string = toml_edit::ser::to_string_pretty(&config)?;
tokio::fs::write(&format!("ffplayout_{id}.toml"), toml_string).await?;