feat: implement transcode settings repository and integrate with local-files provider
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user