feat: implement transcode settings repository and integrate with local-files provider

This commit is contained in:
2026-03-16 04:24:39 +01:00
parent 50df852416
commit 9d792249c9
12 changed files with 269 additions and 177 deletions

View File

@@ -269,15 +269,11 @@ async fn update_transcode_settings(
CurrentUser(_user): CurrentUser,
Json(req): Json<UpdateTranscodeSettingsRequest>,
) -> Result<Json<TranscodeSettingsResponse>, ApiError> {
let pool = state.sqlite_pool.read().await.clone()
.ok_or_else(|| ApiError::not_implemented("sqlite not available"))?;
let ttl = req.cleanup_ttl_hours as i64;
sqlx::query("UPDATE transcode_settings SET cleanup_ttl_hours = ? WHERE id = 1")
.bind(ttl)
.execute(&pool)
.await
.map_err(|e| ApiError::internal(e.to_string()))?;
if let Some(repo) = &state.transcode_settings_repo {
repo.save_cleanup_ttl(req.cleanup_ttl_hours)
.await
.map_err(|e| ApiError::internal(e.to_string()))?;
}
let tm_opt = state.transcode_manager.read().await.clone();
if let Some(tm) = tm_opt {