fix: sync cleanup_ttl_hours to transcode_settings table on provider save

This commit is contained in:
2026-03-16 04:02:58 +01:00
parent 0637504974
commit d88afbfe2e

View File

@@ -168,6 +168,15 @@ async fn rebuild_registry(state: &AppState) -> DomainResult<()> {
Arc::new(infra::LocalFilesProvider::new(Arc::clone(&idx), lf_cfg, tm.clone())),
);
// Sync cleanup_ttl_hours to transcode_settings table so
// GET /files/transcode-settings returns the configured value.
let _ = sqlx::query(
"UPDATE transcode_settings SET cleanup_ttl_hours = ? WHERE id = 1",
)
.bind(cleanup_ttl_hours as i64)
.execute(&sqlite_pool)
.await;
*state.local_index.write().await = Some(idx);
*state.transcode_manager.write().await = tm;
*state.sqlite_pool.write().await = Some(sqlite_pool);